10_Graph theory and network flow problems Flashcards
Directed Graph
G = (V,A,c)
- is made of a set of nodes V
- and set of arcs A (i,j)
- weights of arcs denoted as c(ij)
Undirected Graph
G = [V,A,c]
- is made of a set of nodes V and a set of edges A
- an edge [i,j] is defined by the 2 nodes i and j
- edges have costs c
Dijkstra Algorithm
Prerequisites
- directed or undirected graph
- graph cannot have cycles
- no negative weights
Floyd Warshall Algorithm
Prerequisites
- weights can be negative
- graph can have cycles
How to determine shortest path with Floyd-Warshall-Algorithm
- shortes path from node i to j
- D(16) = 6
- p(1,2) = 1
- p (2,5) = 2
p = predecessor
Avoid Mistake with Floyd-Warshall-Algorithm
- check whether a node below current iteration node is changed
Methods for Graph Theory
- Dijkstra’s Algorithm
- Floyd-Warshall Algorithm
- Minimum Spanning Tree Problem
Network Flow Problems
Methods
- solving Maximum Flow Problem with Ford-Fulkerson Algorithm
How to determine Minimum Cut in Ford-Fulkerson Algorithm
- using last iteration when algorithm stopped
- anything in last column will be in V(q) anything else in V(s)
- Capacity K: maximum outflows - minimum inflows
Minimum Spanning Tree Problem
* Prerequisites
* Procedure
Prerequisites
- undirectd graph with edge weights
Procedure
- determine list of undirected edges starting with smallest weight in ascending order
- stop algorithm at n-1
- add edges to graph so that it doesnt have a cycle