Unit 5 - Shortest Path Problem Flashcards
Diagraph or Directed graph
Is a graph in which the edges have a direction.
The pair of nodes (i,j) is always an ordered pair, starting node i and ending node j.
In-degree
Indicates how many directed edges leads to this node.
Out-degree
Indicates how many directed edges leads away from this node.
How to calculate the degree of a node in a diagraph?
The degree of a node in a diagraph is the sum of the input and output nodes.
The adiacent matrix of a diagraph is symmetric?
Generally no, because an arrow connects a node to another in only one direction.
Weighted graph
It’s a graph where there’s a mapping that assigns to every edge a weight.
Unweighted graph
A graph without a weight function.
How to assign a weight?
Wij = w({ Vi,Vj })
What’s the weight of the elements on the main diagonal of a weighted graph?
0, it cost nothing to stay in one node.
Dijkstra’s algorithm
Determines the shortest path from a starting node to all other nodes in a weighted simple graph with non-negative weights.
Dijkstra’s algorithm steps
The algorithm iteratively goes to the successor node with the shortest path known so far and tests wether a shorter path to one of the neighboring nodes can be found via this node.