![]() ![]() The existence of a topological ordering can therefore be used as an equivalent definition of a directed acyclic graphs: they are exactly the graphs that have topological orderings. Conversely, every directed acyclic graph has at least one topological ordering. Therefore, every graph with a topological ordering is acyclic. A graph that has a topological ordering cannot have any cycles, because the edge into the earliest vertex of a cycle would have to be oriented the wrong way. For each red or blue edge u → v, v is reachable from u: there exists a blue path starting at u and ending at v.Ī topological ordering of a directed graph is an ordering of its vertices into a sequence, such that for every edge the start vertex of the edge occurs earlier in the sequence than the ending vertex of the edge. ![]() Topological ordering Īdding the red edges to the blue directed acyclic graph produces another DAG, the transitive closure of the blue graph. A Hasse diagram of a partial order is a drawing of the transitive reduction in which the orientation of every edge is shown by placing the starting vertex of the edge in a lower position than its ending vertex. Transitive reductions are useful in visualizing the partial orders they represent, because they have fewer edges than other graphs representing the same orders and therefore lead to simpler graph drawings. In contrast, for a directed graph that is not acyclic, there can be more than one minimal subgraph with the same reachability relation. Like the transitive closure, the transitive reduction is uniquely defined for DAGs. It is a subgraph of the DAG, formed by discarding the edges u → v for which the DAG also contains a longer directed path from u to v. It has an edge u → v for every pair of vertices ( u, v) in the covering relation of the reachability relation ≤ of the DAG. The transitive reduction of a DAG is the graph with the fewest edges that has the same reachability relation as the DAG. In this way, every finite partially ordered set can be represented as a DAG.Ī Hasse diagram representing the partial order of set inclusion (⊆) among the subsets of a three-element set The same method of translating partial orders into DAGs works more generally: for every finite partially ordered set ( S, ≤), the graph that has a vertex for every element of S and an edge for every pair of elements in ≤ is automatically a transitively closed DAG, and has ( S, ≤) as its reachability relation. It has an edge u → v for every pair of vertices ( u, v) in the reachability relation ≤ of the DAG, and may therefore be thought of as a direct translation of the reachability relation ≤ into graph-theoretic terms. The transitive closure of a DAG is the graph with the most edges that has the same reachability relation as the DAG. Both of these DAGs produce the same partial order, in which the vertices are ordered as u ≤ v ≤ w. For example, a DAG with two edges u → v and v → w has the same reachability relation as the DAG with three edges u → v, v → w, and u → w. However, different DAGs may give rise to the same reachability relation and the same partial order. In this partial order, two vertices u and v are ordered as u ≤ v exactly when there exists a directed path from u to v in the DAG that is, when u can reach v (or v is reachable from u). The reachability relation of a DAG can be formalized as a partial order ≤ on the vertices of the DAG. ![]() Mathematical properties Reachability relation, transitive closure, and transitive reduction If a vertex can reach itself via a nontrivial path (a path with one or more edges), then that path is a cycle, so another way to define directed acyclic graphs is that they are the graphs in which no vertex can reach itself via a nontrivial path. As a special case, every vertex is considered to be reachable from itself (by a path with zero edges). Ī vertex v of a directed graph is said to be reachable from another vertex u when there exists a path that starts at u and ends at v. A directed acyclic graph is a directed graph that has no cycles. A path in a directed graph is a sequence of edges having the property that the ending vertex of each edge in the sequence is the same as the starting vertex of the next edge in the sequence a path forms a cycle if the starting vertex of its first edge equals the ending vertex of its last edge. In the case of a directed graph, each edge has an orientation, from one vertex to another vertex. 3.3 Transitive closure and transitive reductionĪ graph is formed by vertices and by edges connecting pairs of vertices, where the vertices can be any kind of object that is connected in pairs by edges.3.1 Topological sorting and recognition.2.1 Reachability relation, transitive closure, and transitive reduction. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |