Théorie des graphes : Types de graphes et parcours
Fundamental Concepts and Graph Typology
Definition of Graph Orientation Types:
- Directed Graph (Graphe orienté): A graph containing exclusively directed edges, known as arcs. Graphs and are examples of directed graphs.
- Undirected Graph (Graphe non orienté): A graph containing exclusively undirected edges, known as edges (arêtes). Graphs and are examples of undirected graphs.
- Mixed Graph (Graphe mixte): A graph containing both directed edges (arcs) and undirected edges (edges). Graph is an example of a mixed graph.
- Orientation Inversion Rule: In a directed graph, if an arc is traversed in the indirect direction (contrary to the arrow's orientation), the arc is treated and classified as an edge.
Definition and Interpretations of Weighted Graphs (Graphes valués):
- Definition: A graph is valued (or weighted) if every arc or edge is assigned a numerical value, typically denoted by . Graph is a valued graph, whereas the other graphs are unweighted.
- Physical and Operational Interpretations of :
- The physical distance between vertex and vertex .
- The travel time or transit duration required to move from to .
- The travel or transportation cost incurred from to .
- The maximum capacity of information, data packets, or physical merchandise permitted to traverse the arc.
- The maximum flow capacity transferable from vertex to vertex .
Graph Connectivity Categories:
- Connected Graph (Graphe connexe): A graph where any two arbitrary vertices are linked to one another by either a path or a chain. Graph is connected.
- Non-Connected Graph (Graphe non connexe): A graph where there exist at least two vertices that are not connected by any path or chain. Graph is non-connected.
- Strongly Connected Graph (Graphe fortement connexe): A directed graph where any two arbitrary vertices are obligatorily connected to each other by a directed path in both directions. Graph is strongly connected.
Vertex Degrees and Formulas:
- General Degree: The degree of a vertex in a graph is the total count of arcs or edges adjacent to that vertex.
- Directed Graph Demidegrees:
- In-Degree (Demi-degré intérieur) : The total count of incoming arcs entering vertex .
- Out-Degree (Demi-degré extérieur) : The total count of outgoing arcs leaving vertex .
- Total Degree Equation: The total degree of a vertex equals the arithmetic sum of its in-degree and its out-degree:
- Concrete Degree Values:
- In graph : for vertex , , , yielding total degree .
- In graph : for vertex , , , yielding total degree .
- In graph : for vertex , total degree .
Regular Graphs (Graphe régulier):
- Definition: A graph is termed regular if and only if all vertices in the graph share the identical degree.
- Example: Graph is a regular graph.
Predecessors, Successors, Graph Entries, and Graph Exits:
- Predecessor (Prédécesseur): For a given directed arc , vertex is the initial extremity and is designated as the predecessor of vertex . Equivalently, is a predecessor of if there exists an arc having as its origin and as its destination. The set of all predecessors of vertex is denoted by .
- Successor (Successeur): For a given directed arc , vertex is the terminal extremity and is designated as the successor of vertex . Equivalently, is a successor of if there exists an arc having as its origin and as its destination. The set of all successors of vertex is denoted by .
- Graph Entry / Source (Entrée du graphe): If , vertex has no incoming arcs and is called an entry of the graph.
- Graph Exit / Sink (Sortie du graphe): If , vertex has no outgoing arcs and is called an exit of the graph.
- Concrete Examples from Graph :
- : Vertex constitutes the entry of graph .
- .
- ; .
- ; .
- : Vertex constitutes the exit of graph .
Paths, Chains, Circuits, and Cycles
Fundamental Sequence Definitions:
- Path (Chemin): A sequence of arcs sharing common extremities, such that the terminal extremity of the preceding arc becomes the initial extremity of the immediately succeeding arc.
- Chain (Chaîne): A sequence of undirected edges sharing common extremities, such that the terminal extremity of the preceding edge becomes the initial extremity of the succeeding edge.
- Transformation Rule: If an undirected edge is introduced into a path, that path ceases to be a path and becomes a chain.
- Circuit (Circuit): A path that begins and terminates at the very same vertex (a closed directed path).
- Cycle (Cycle): A chain that begins and terminates at the very same vertex (a closed undirected sequence of edges).
Subtypes of Paths:
- Optimal or Critical Path (Chemin critique ou optimal): A path exhibiting the maximal possible value (longest path) or the minimal possible value (shortest path). Minimization scenarios define the shortest path, whereas maximization scenarios define the longest path.
- Elementary Path (Chemin élémentaire): A path traversing any given vertex of the graph at most once (one and only once).
- Simple Path (Chemin simple): A path traversing any given arc of the graph at most once (one and only once).
- Hamiltonian Path (Chemin hamiltonien): A path traversing every single vertex of the graph exactly once (one and only once).
Concrete Examples and Counterexamples:
- In graph :
- Paths: is a path, where and are arcs.
- Chains: If edges and are present, the sequence constitutes a chain.
- Elementary Paths: and are elementary paths because each vertex appears once.
- Simple Non-Elementary Path: traverses no arc twice, qualifying as simple, but may not be elementary if a vertex repeats.
- Non-Simple Non-Elementary Path: A sequence such as that revisits both vertices and arcs is neither simple nor elementary.
- Hamiltonian Path: The path sequence visits every vertex of graph once and only once.
- In graph :
- Edges: and are edges.
- Chain: The progression is an undirected chain.
- Cycle: The closed loop starts and ends at , forming a cycle.
Forms of Graph Presentation
Sagittal Form (Forme sagittale):
- A graphical, diagrammatic representation plotted in the geometric plane depicting the complete set of vertices together with their connecting arcs or edges. Graphs through are presented under this sagittal form.
Matrix Form (Forme matricielle):
- A double-entry matrix where rows designate the initial extremity vertices (predecessors) and columns designate the terminal extremity vertices (successors).
- At the intersection of row and column , the matrix entry is set to the weight if arc exists, and if the arc does not exist.
- Whether structured by successor/predecessor or predecessor/successor orientation, the structural matrix remains invariant.
Dictionary Form (Forme du dictionnaire):
- A comprehensive tabular schedule recording, for each individual vertex, its exhaustive set of predecessors and its exhaustive set of successors.
- Complete Dictionary for Graph (Vertices through ):
- Vertex : Predecessors ; Successors
- Vertex : Predecessors ; Successors
- Vertex : Predecessors ; Successors
- Vertex : Predecessors ; Successors
- Vertex : Predecessors ; Successors
- Vertex : Predecessors ; Successors
- Vertex : Predecessors ; Successors
- Vertex : Predecessors ; Successors
- Vertex : Predecessors ; Successors
- Vertex : Predecessors ; Successors
- Vertex : Predecessors ; Successors
Exhaustive List Form (Forme d'une liste exhaustive des sommets et arcs):
- An explicit set-theoretic enumeration listing in extension the complete set of all vertices and the complete set of all directed arcs or edges comprising the graph.
Vertex Level Decomposition Algorithm
Conceptual Definition and Operational Role:
- The level of a vertex in a directed acyclic graph represents the maximal number of paths (or maximal path length) extending from the graph entry to that vertex.
- It serves as an indicator of the degree of utilization of each vertex, dictating the precise topological rank and sequential order in which vertices must be evaluated in optimization algorithms.
Step-by-Step Construction Procedure:
- Level 1 (Niveau 1): Identify all vertices possessing no predecessors in the predecessor dictionary. Assign these vertices to Level 1. In graph , this is vertex .
- Level 2 (Niveau 2): Temporarily eliminate the Level 1 vertices from the predecessor listings. Identify all vertices that now have no remaining predecessors. Assign these vertices to Level 2. In graph , these are vertices and .
- Iterative Levels (Niveau 3 onwards): Continue this elimination procedure iteratively until all predecessors have been processed and removed from every vertex.
Exhaustive Level Assignment for Graph :
- Level 1:
- Level 2:
- Level 3:
- Level 4:
- Level 5:
- Level 6:
- Level 7:
- Level 8:
Ford's Algorithm for Optimal Paths
Objective and Applicability Conditions:
- Designed to construct an optimal path (shortest or longest) from the entry vertex to the exit vertex of a directed, valued, connected graph whose vertices are defined by their sets of predecessors.
- Requires topological ordering of vertices by levels to prevent cyclic dependencies.
Algorithmic Principle and Potential Formulation:
- Each vertex is assigned a scalar potential/coefficient denoted by , representing the cumulative optimal value of the path originating from the entry vertex up to vertex .
- Step 1 (Ranking): Sort and rank all graph vertices into sequential levels.
- Step 2 (Initialization): Assign coefficient to the entry vertex:
- Step 3 (Recurrence Relation):
- For the shortest path (minimization):
- For the longest path (maximization):
- Step 4 (Termination): If denotes the exit vertex of the graph, the computed coefficient represents the optimal path value connecting the entry to the exit.
Comprehensive Step-by-Step Shortest Path Evaluation on Graph :
- Entry Initialization:
- Vertex :
- Vertex :
- Vertex :
- Vertex :
- Vertex :
- Vertex :
- Vertex :
- Vertex :
- Vertex :
- Vertex (Exit):
- Final Shortest Path Value: The shortest path between entry and exit equals .
- Path Reconstruction: The optimal shortest path trajectory is determined by tracing back the minimizing predecessors starting from the exit vertex back to the entry vertex .
Dijkstra's Algorithm for Shortest Paths
Objective and Scope:
- Determines the shortest path connecting the entry vertex to the exit vertex of a directed, connected graph with non-negative arc valuations, where vertices are defined by their sets of successors.
Algorithmic Principle and Step-by-Step Procedure:
- Assigns each vertex a label reflecting the shortest distance from the entry vertex.
- Step 1 (Initialization):
- In the initial row of an evaluation matrix, list all vertices of the graph.
- Assign coefficient to the entry vertex and to all other vertices.
- Select the entry vertex (marking it as permanent) and eliminate its corresponding column from further selection.
- Step 2 (Initial Current Row Construction):
- For every vertex that is a direct successor of the entry vertex, set to the value of the arc spanning from the entry to .
- Retain all other vertex coefficients at .
- Identify and select the uneliminated vertex possessing the minimum coefficient, and eliminate its column.
- Step 3 (Iterative Row Updates):
- Let be the vertex selected in the previous iteration.
- For every uneliminated successor vertex , compute its candidate coefficient:
- If , overwrite the label: .
- If , maintain the existing label value unchanged.
- For vertices that are not direct successors of , carry over their coefficients unchanged.
- Select the vertex displaying the strictly smallest coefficient across the current row, and eliminate its column.
- Step 4 (Stopping Criterion):
- If all matrix columns have been eliminated, terminate the procedure.
- Otherwise, repeat Step 3.
Tabular Execution and Selection Sequence for Graph :
- Columns track vertices .
- Row 1: , all others . Select with coefficient .
- Row 2: Successors of updated: , , , . Minimal coefficient is (tie between and ). Select with coefficient .
- Row 3: Successors of evaluated: , . Minimal coefficient across active vertices is at . Select with coefficient .
- Row 4: Successors of evaluated: , , . Minimal coefficient is at . Select with coefficient .
- Row 5: Successors of evaluated: updates to or . Minimal active labels evaluated. Iteratively selects vertices: (), (), (), (), (), (), and finally ().
- Final Output: The optimal shortest path terminates at exit vertex with a minimal cumulative distance of .
Floyd-Warshall Algorithm for All-Pairs Shortest Paths
Objective and Specific Characteristics:
- Determines the complete matrix of shortest paths between every pair of arbitrary vertices in a weighted graph.
- Supports both directed and undirected graphs.
- Accommodates arbitrary capacities or edge weights that need not be strictly positive, provided there exist no negative/absorbent circuits.
Algorithmic Framework and Dual Matrices:
- Operates by iteratively generating a distance matrix (shortest path lengths) and a tracking matrix (intermediate routing vertices).
- Step 0 (Initialization):
- Assume all vertices are initially connected only by direct arcs.
- Construct initial matrix where entry is the direct edge length , with diagonal elements set to and non-adjacent pairs set to .
- Construct intermediate vertex matrix where entry if a direct connection exists, and otherwise.
- Step (Routing via Vertex ):
- At iteration , vertex is introduced as an intermediate routing vertex.
- For every pair of vertices , compare two path alternatives:
- Direct path from to with current length .
- Indirect path via () with combined length .
- Update Condition:
- If :
- In matrix , update the cell: .
- In matrix , record the intermediate vertex: .
- If :
- In matrix , maintain the previous value: .
- In matrix , maintain the previous entry: .
- Matrix Construction Invariant: Row and column remain completely unchanged when transitioning from to .
- Step (Termination Criterion):
- For a graph containing vertices, the process concludes after constructing matrix and matrix , fixing vertex as the final intermediate node.
- contains the all-pairs shortest distances; allows the reconstruction of all optimal paths.
Interpretation and Path Reconstruction from Matrix :
- If , vertex is directly connected to vertex along the optimal path.
- If (with ), the optimal trajectory from to traverses intermediate vertex , requiring decomposition into subpaths and .
Full Execution on a 5-Vertex Graph ( through ):
- Initial State ():
- Direct distance matrix :
- Intermediate tracking matrix :
- Iteration 1 (, Vertex Fixed):
- Updating paths through : for example, path from to via has length , updating and .
- Distance matrix :
- Tracking matrix :
- Iteration 2 (, Vertex Fixed):
- Row 2 and Column 2 remain invariant. Updates paths passing through .
- Distance matrix :
- Tracking matrix :
- Iteration 3 (, Vertex Fixed):
- Row 3 and Column 3 remain invariant. Updates paths passing through .
- Distance matrix :
- Tracking matrix incorporates routing node updates.
- Iteration 4 (, Vertex Fixed):
- Row 4 and Column 4 remain invariant. Distance matrix and tracking matrix calculated.
- Iteration 5 (, Vertex Fixed):
- Final distance matrix :
- Final tracking matrix :
Optimal Path Extraction Example:
- To extract the shortest path between vertex and vertex :
- The entry in distance matrix yields a value of (or if direct, with depending on orientation).
- Querying tracking matrix indicates intermediate vertex .
- The sequence decomposes into .
- The optimal cumulative cost for this route equals .