aij: Cost from node i to j (aij=∞ if no direct path)
Key assumption: All cycles have non-negative cost (∀ cycles i→j1→⋯→jk→i,total cost≥0)
Goal: Find min-cost path from any i to t
Significance of Non-negative Cycle Assumption
Core implication: Guarantees existence of optimal solution with finite path length
Prevents infinite cost reduction:
If ∃ negative cycle cycle∑aij<0⇒total cost can be arbitrarily reduced
Example: Repeated traversal of negative-cost cycle drives cost to −∞
Self-loop constraint:
aii≥0(if self-transitions allowed)
Path length bound:
Optimal path contains at most N moves
Can enforce exactly N moves by setting aii=0 (allowing self-loops)
Dynamic Programming Formulation
Define value function:
Jk(i)=Min cost from i to t in exactly k steps
Recursion:
Jk(i)=jmin[aij+Jk−1(j)]
Boundary conditions:
J0(t)=0,J0(i)=∞(i=t)
Practical meaning of non-negative cycle assumption:
This assumption ensures the shortest path problem is well-posed with a finite optimal solution. Negative-cost cycles would cause algorithms to loop indefinitely without convergence.
In real-world applications (routing, network optimization), this condition is naturally satisfied when costs represent physical quantities like distance or latency.
Deterministic Dynamic Programming
Characteristics of Deterministic Systems
Key feature: No stochastic disturbance (wk absent or known constant)
Fully predictable state transition:
xk+1=fk(xk,uk)
State trajectory can be exactly computed given x0 and policy {μ0,…,μN−1}
No advantage of closed-loop control:
Jclosed-loop=Jopen-loop
Optimal open-loop sequence (u0∗,u1∗,…,uN−1∗) achieves same cost as closed-loop policy
Why no closed-loop advantage:
In deterministic systems, future states are entirely determined by current decisions. State feedback provides no new information, so closed-loop policies cannot improve upon precomputed open-loop sequences.
Finite-State System Modeling
State transition graph representation:
Nodes: States xk∈Sk (finite set)
Directed edges: State transitions driven by control uk
xkukxk+1=fk(xk,uk)
Edge cost: Stage cost gk(xk,uk)
Key simplification:
For each state transition xk→xk+1, keep only minimum-cost decision:
Computational implication: Transforms problem into multi-stage shortest path
Essence of finite-state systems:
Modeling as state transition graphs reduces the problem to finding minimum-cost paths. DP becomes a backward graph traversal algorithm in this context.
Equivalence: Deterministic Finite-State Systems & Shortest Path Problems
Deterministic System → SPP
Transformation:
Define nodes:
s: Initial state node (corresponds to x0)
t: Terminal node (artificially added)
Edge costs:
Stage k transition: aijk=minukgk(i,uk) (when fk(i,uk)=j)
i: Current state
j: Next state
uk: Control decision
gk: Stage cost function
Terminal cost: aitN=gN(i)
gN: Terminal cost function
Path cost:
Total cost=k=0∑N−1axkxk+1k+axNtN
Core equivalence: Optimal cost =J0(s)= Shortest path length from s to t
Backward DP Algorithm
Value function:
Jk(i)=Min cost from state i at stage k to terminal t
k: Current stage
i: Current state
Recursion:
JN(i)Jk(i)=aitN∀i∈SN(Terminal cost: direct cost from state i to t)=j∈Sk+1min[aijk+Jk+1(j)]k=N−1,…,0(Minimize: transition cost aijk + optimal future cost Jk+1(j))
Optimal solution: J0(s) gives shortest path length (min cost from initial state s to terminal t)
SPP → Deterministic System
Transformation:
Fix number of stages N (guaranteed by non-negative cycles)
Key point: J0(i) gives shortest path cost from i to t
Forward DP Algorithm (Special Property)
Only for deterministic SPP:
Value function:
J~k(j)=Min cost from s to j (stage k)
k: Current stage
j: Current state
Recursion:
J~1(j)J~k(j)J~0(t)=asj0∀j∈S1(Cost from initial state s to stage 1 state j)=i∈Sk−1min[aijN−k+1+J~k−1(i)]k=2,…,N(Minimize: transition cost aijN−k+1 + optimal past cost J~k−1(i))=i∈SNmin[aitN+J~N(i)](Terminal cost: from state i to t + optimal cost to i)
Comparison:
Backward DP computes “cost-to-go”, forward DP computes “cost-to-arrive”.
Equivalent in deterministic SPP due to path symmetry, but forward method inapplicable to stochastic problems.
Shortest Path Application: Critical Path Analysis
Problem Description
Application scenario: Activity scheduling optimization in project management
Core objectives:
Determine minimum project duration
Identify critical activities (delays cause project delay)
Case Study: Dr. Yang’s Schedule Optimization
Activity decomposition:
Activity
Description
Meeting with TAs
Must complete
Replying emails
Lunch
Meeting with PhD students
MSc program work
Teaching
Phase division:
Nodes represent schedule phases (N=5)
Edge (i,j) represents activity with duration tij>0
Node 1: Start of day (no incoming edges)
Node 5: End of day (no outgoing edges)
Critical Path Algorithm
Variable
Symbol
Definition
Path Duration
Dp
Total duration of path p Calculation: Dp=∑(i,j)∈ptij
Earliest Completion Time
Ti
Earliest completion time at node i Calculation: Ti=maxall paths p from 1 to iDp
Activity Duration
tji
Duration of activity (j,i) (Edge weight from node j to i)
Predecessor Set
Pred(i)
Set of direct predecessor nodes of i (Nodes with edges pointing directly to i)
Critical Activity Condition
Ti=Tj+tji
Necessary and sufficient condition for activity (j,i) to be critical (Activity has zero slack when this holds)
Slack Time
Slackji
Delay tolerance for non-critical activities Calculation: Slackji=Ti−(Tj+tji)
Path duration calculation:
Dp=(i,j)∈p∑tij(total duration of path p)
Earliest completion time:
Ti=all paths p from 1 to imaxDp(earliest completion time at node i)
Critical path definition:
Critical path=argpmaxDp(longest path from node 1 to 5)
Dynamic Programming Solution
Value function:
Ti=Earliest completion time at node i
Recursion:
Ti=j∈Pred(i)max(Tj+tji)
where Pred(i) is the set of direct predecessors of node i
Boundary condition:
T1=0
Critical activity identification:
Activity (j,i) is critical iff: