Un proyecto, contempla la siguiente lista de activ...
Erstellt am: 19. Oktober 2025
Beantwortet mit GPT-5 Thinking von Chat01
Erstellt am: 19. Oktober 2025
Beantwortet mit GPT-5 Thinking von Chat01
Un proyecto, contempla la siguiente lista de actividades, junto con sus tiempos requeridos de terminación.
Actividad Tiempo Precedentes inmediatos
A 1 _ _
B 4 A
C 3 A
D 7 A
E 6 B
F 2 C,D
G 7 E,F
H 9 D
I 4 G,H
texta. Determine el diagrama de Ruta Crítica. b. Muestre los tiempos de inicio temprano, terminación temprana, inicio tardío y terminación tardía. c. Muestre la ruta crítica. d. ¿Qué ocurriría si la actividad F, se modificara para que tarde cuatro días, en lugar de dos?
C.R.: Para el logro del objetivo 9, Ud. debe responder correctamente todas las preguntas con los siguientes aspectos:
El procedimiento desarrollado se debe justificar detalladamente.
El resultado final debe estar correcto y simplificado.
Debe trabajar de manera ordenada y secuencialmente.
python# Let's compute CPM for the given network. from collections import defaultdict, deque activities = { 'A': {'dur': 1, 'pred': []}, 'B': {'dur': 4, 'pred': ['A']}, 'C': {'dur': 3, 'pred': ['A']}, 'D': {'dur': 7, 'pred': ['A']}, 'E': {'dur': 6, 'pred': ['B']}, 'F': {'dur': 2, 'pred': ['C','D']}, 'G': {'dur': 7, 'pred': ['E','F']}, 'H': {'dur': 9, 'pred': ['D']}, 'I': {'dur': 4, 'pred': ['G','H']}, } # compute topological order # build successors for later succ = defaultdict(list) in_deg = defaultdict(int) for a, info in activities.items(): in_deg[a] = len(info['pred']) for p in info['pred']: succ[p].append(a) # Kahn order = [] dq = deque([a for a in activities if in_deg[a]==0]) while dq: n = dq.popleft() order.append(n) for s in succ[n]: in_deg[s]-=1 if in_deg[s]==0: dq.append(s) order ['A', 'B', 'C', 'D', 'E', 'F', 'H', 'G', 'I']
python# forward pass ES = {} EF = {} for a in order: preds = activities[a]['pred'] if not preds: ES[a] = 0 else: ES[a] = max(EF[p] for p in preds) EF[a] = ES[a] + activities[a]['dur'] ES, EF ({'A': 0, 'B': 1, 'C': 1, 'D': 1, 'E': 5, 'F': 8, 'H': 8, 'G': 11, 'I': 18}, {'A': 1, 'B': 5, 'C': 4, 'D': 8, 'E': 11, 'F': 10, 'H': 17, 'G': 18, 'I': 22})
python# backward pass project_duration = EF['I'] # 22 LS = {} LF = {} for a in reversed(order): # successors; if none, LF = project_duration su = succ[a] if not su: LF[a] = project_duration else: LF[a] = min(LS[s] for s in su) LS[a] = LF[a] - activities[a]['dur'] LS, LF, project_duration ({'I': 18, 'G': 11, 'H': 9, 'F': 9, 'E': 5, 'D': 2, 'C': 6, 'B': 1, 'A': 0}, {'I': 22, 'G': 18, 'H': 18, 'F': 11, 'E': 11, 'D': 9, 'C': 9, 'B': 5, 'A': 1}, 22)
pythonslack = {a: LS[a]-ES[a] for a in activities} slack {'A': 0, 'B': 0, 'C': 5, 'D': 1, 'E': 0, 'F': 1, 'G': 0, 'H': 1, 'I': 0}
pythonactivities2 = {k: v.copy() for k,v in activities.items()} activities2['F'] = {'dur': 4, 'pred': ['C','D']} # rebuild succ/in_deg for this network succ2 = defaultdict(list) in_deg2 = defaultdict(int) for a, info in activities2.items(): in_deg2[a] = len(info['pred']) for p in info['pred']: succ2[p].append(a) order2 = [] dq = deque([a for a in activities2 if in_deg2[a]==0]) while dq: n = dq.popleft() order2.append(n) # forward ES2={}; EF2={} for a in order2: preds = activities2[a]['pred'] ES2[a] = 0 if not preds else max(EF2[p] for p in preds) EF2[a] = ES2[a] + activities2[a]['dur'] # backward project_duration2 = EF2['I'] LS2={}; LF2={} for a in reversed(order2): su = succ2[a] if not su: LF2[a] = project_duration2 else: LF2[a] = min(LS2[s] for s in su) LS2[a] = LF2[a] - activities2[a]['dur'] slack2 = {a: LS2[a]-ES2[a] for a in activities2} project_duration2, ES2, EF2, LS2, LF2, slack2
pythonorder2 ['A']
pythonin_deg2 defaultdict(int, {'A': 0, 'B': 1, 'C': 1, 'D': 1, 'E': 1, 'F': 2, 'G': 2, 'H': 1, 'I': 2})
pythonsucc2 defaultdict(list, {'A': ['B', 'C', 'D'], 'B': ['E'], 'C': ['F'], 'D': ['F', 'H'], 'E': ['G'], 'F': ['G'], 'G': ['I'], 'H': ['I']})
python# Let's recompute Kahn step-by-step to see. from collections import deque in_deg2c = in_deg2.copy() dq = deque([a for a in activities2 if in_deg2c[a]==0]) seq=[] while dq: n = dq.popleft() seq.append(n) for s in succ2[n]: in_deg2c[s]-=1 if in_deg2c[s]==0: dq.append(s) seq, in_deg2c (['A', 'B', 'C', 'D', 'E', 'F', 'H', 'G', 'I'], defaultdict(int, {'A': 0, 'B': 0, 'C': 0, 'D': 0, 'E': 0, 'F': 0, 'G': 0, 'H': 0, 'I': 0}))
pythonorder2 = seq # forward ES2={}; EF2={} for a in order2: preds = activities2[a]['pred'] ES2[a] = 0 if not preds else max(EF2[p] for p in preds) EF2[a] = ES2[a] + activities2[a]['dur'] project_duration2 = EF2['I'] # backward LS2={}; LF2={} for a in reversed(order2): su = succ2[a] if not su: LF2[a] = project_duration2 else: LF2[a] = min(LS2[s] for s in su) LS2[a] = LF2[a] - activities2[a]['dur'] slack2 = {a: LS2[a]-ES2[a] for a in activities2} project_duration2, ES2, EF2, LS2, LF2, slack2 (23, {'A': 0, 'B': 1, 'C': 1, 'D': 1, 'E': 5, 'F': 8, 'H': 8, 'G': 12, 'I': 19}, {'A': 1, 'B': 5, 'C': 4, 'D': 8, 'E': 11, 'F': 12, 'H': 17, 'G': 19, 'I': 23}, {'I': 19, 'G': 12, 'H': 10, 'F': 8, 'E': 6, 'D': 1, 'C': 5, 'B': 2, 'A': 0}, {'I': 23, 'G': 19, 'H': 19, 'F': 12, 'E': 12, 'D': 8, 'C': 8, 'B': 6, 'A': 1}, {'A': 0, 'B': 1, 'C': 4, 'D': 0, 'E': 1, 'F': 0, 'G': 0, 'H': 2, 'I': 0})
¡Vamos paso a paso (CPM/PERT, actividades en nodos) y con todo el procedimiento!
textInicio └─ A(1) ├─ B(4) ── E(6) ──┐ ├─ C(3) ── F(2) ──┤ └─ D(7) ── H(9) ──┤ └─ F(2) ─┘ └─ G(7) ── I(4) ── Fin
Interpretación: las flechas van “de predecesora → sucesora”; el número entre paréntesis es la duración (días).
| Act. | Dur. | Predecesoras | ES | EF | LS | LF | Holgura |
|---|---|---|---|---|---|---|---|
| A | 1 | — | 0 | 1 | 0 | 1 | 0 |
| B | 4 | A | 1 | 5 | 1 | 5 | 0 |
| C | 3 | A | 1 | 4 | 6 | 9 | 5 |
| D | 7 | A | 1 | 8 | 2 | 9 | 1 |
| E | 6 | B | 5 | 11 | 5 | 11 | 0 |
| F | 2 | C,D | 8 | 10 | 9 | 11 | 1 |
| G | 7 | E,F | 11 | 18 | 11 | 18 | 0 |
| H | 9 | D | 8 | 17 | 9 | 18 | 1 |
| I | 4 | G,H | 18 | 22 | 18 | 22 | 0 |
Duración total del proyecto: 22 días (EF de I).
Las actividades con holgura = 0 son: A → B → E → G → I.
Ruta crítica: A–B–E–G–I (1 + 4 + 6 + 7 + 4 = 22).
Repetimos el cálculo cambiando solo .
| Act. | Dur. | ES | EF | LS | LF | Holgura |
|---|---|---|---|---|---|---|
| B | 4 | 1 | 5 | 2 | 6 | 1 |
| D | 7 | 1 | 8 | 1 | 8 | 0 |
| E | 6 | 5 | 11 | 6 | 12 | 1 |
| F | 4 | 8 | 12 | 8 | 12 | 0 |
| G | 7 | 12 | 19 | 12 | 19 | 0 |
| H | 9 | 8 | 17 | 10 | 19 | 2 |
| I | 4 | 19 | 23 | 19 | 23 | 0 |
Nueva duración del proyecto: 23 días.
Nueva ruta crítica: A–D–F–G–I (1 + 7 + 4 + 7 + 4 = 23).
Conclusión del cambio: Aumentar F de 2→4 días desplaza la ruta crítica desde A–B–E–G–I a A–D–F–G–I, incrementando el plazo total 1 día (de 22 a 23).