-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprecedence.py
More file actions
158 lines (146 loc) · 3.62 KB
/
precedence.py
File metadata and controls
158 lines (146 loc) · 3.62 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
"""
A collection of precedence tables, for use in the actnet, critical and gannt modules
"""
p1 = [
["A", [], 11],
["B", [], 18],
["C", ["A"], 14],
["D", ["A"], 8],
["E", ["B"], 2],
["F", ["C", "E"], 7],
["G", ["D", "F"], 3]
]
long_no_dum = [
["A", [], 1],
["B", [], 1],
["C", ["A"], 1],
["D", ["A"], 1],
["E", ["B"], 1],
["F", ["B"], 1],
["G", ["D"], 1],
["H", ["D"], 1],
["I", ["C", "E"], 1],
["J", ["F"], 1],
["K", ["G", "I", "J"], 1],
["L", ["H", "K"], 1]
]
p2 = [
["A", [], 3],
["B", [], 5],
["C", ["A", "B"], 2],
["D", ["A"], 5]
] # a table that requires 1 dummy
fiveBQ5 = [
["P", [], 4],
["Q", [], 6],
["R", ["P"], 4],
["S", ["P"], 7],
["T", ["P", "Q"], 2],
]
umergeable = [
["A", [], 1],
["B", [], 2],
["C", [], 3],
["D", ["A", "B"], 6],
["E", ["A", "C"], 5],
["F", ["B", "C"], 3]
]
p_long = [ # a long and complex table, that nevertheless doesn't need dummies
# 2 critial paths with length 54.
["A", [], 10],
["B", [], 14],
["C", ["A"], 11],
["D", ["B"], 5],
["E", ["B"], 15],
["F", ["B"], 20],
["G", ["C", "D"], 8],
["H", ["C", "D"], 12],
["I", ["G"], 16],
["J", ["E", "H"], 10],
["K", ["E", "H"], 21],
["L", ["E", "H"], 6],
["M", ["I", "J"], 9],
["N", ["F", "L"], 12],
]
line = [
["A", [], 2], #research
["B", ["A"], 4],
["C", ["B"], 2],
["D", ["C"], 3],
["E", ["C"], 1],
["F", ["D"], 3],
["G", ["F"], 1]
]
impossible = [ # nothing checks for this kind of situation. It will cause the
# algorithm to hang
["A", [], 1],
["B", ["C"], 1],
["C", ["D"], 1],
["D", ["B", "A"], 1]
]
p_short = [
["A", [], 2],
["B", [], 7],
["C", ["A"], 4],
["D", ["A"], 3],
["E", ["C"], 2],
["F", ["B", "D"], 4],
["G", ["B"], 1]
]
mix1 = [
["A", [], 10],
["B", [], 15],
["C", ["B"], 11],
["D", ["A","C"], 5],
["E", ["A"], 15],
["F", ["E"], 20],
["G", ["E"], 8],
["H", ["G"], 12],
["I", ["D","F"], 16],
["J", ["G","I"], 10],
["K", ["G","I"], 21],
["L", ["H","K"], 6]
]
tp = [
["i", [], 4],
["ii",["i","v"],2],
["iii",["ii"],2],
["iv",["viii"],5],
["v",[], 6],
["vi",["ix","ii"],4],
["vii",["vi","ii","viii"],6],
["viii",["ii"],5],
["ix",[],5],
["x",["ii"],8]
]
# http://slideplayer.com/slide/3870208/ slide 6
new_prog = [
["A" ,[],1], #hire programmer
["B" ,[],6], #program phase 1
["C",[] ,2], #Obtain marketing backup
["D",["C"] ,1], #consolidate training plans
["E", [],1], #Deliver marketing for training
["F",["D"] ,2], #design training course
["G",["A"],4] ,# renumbering routine
["H",["C"],2], #consolidate advertising
["I",["B"],2], #prepare operating inststuctions
["J",["B","G"],6], #program phase 2
["K",["B","G"],2], #prepare op inst for renumbering
["L",["H"],5], #draft brochure
["M",["H"],4], #submit paper
["N",["H"],4], #national advertising
["O",["E","F"],5], #train marketing
["P",["J","K","I"],2], #pre op inst for phase2
["Q",["I"],2], # Prep phase 1 package
["R",["L"],3], #prep indu app copy
["S",["R"],1], #make ind app copy layout
["T",["S"],1], #print ind app brochure
["U",["L"],2], #make gen bro layout
["V",["U"],1], #print gen brochure
["W",["N"],2], # distribute advertising
["X",["Q","P"],2], #prep complete package
["Y",["Q"],2], #limited dist of phase 1
["Z",["X","Y"],1], #deliver program to marketing
["AA",["T","R"],1], #deliver brochure to marketing
["AB",["O","W","M"],3] #review national ads
]