In mathematics, and, in particular, in graph theory, a rooted graph is a graph in which one vertex has been distinguished as the root.:454 Both directed and undirected versions of rooted graphs have been studied, and there are also variant definitions that allow multiple roots.
Rooted graphs may also be known (depending on their application) as pointed graphs or flow graphs. In some of the applications of these graphs, there is an additional requirement that the whole graph be reachable from the root vertex.
In topological graph theory, the notion of a rooted graph may be extended to consider multiple vertices or multiple edges as roots. The former are sometimes called vertex-rooted graphs in order to distinguish them from edge-rooted graphs in this context. Graphs with multiple nodes designated as roots are also of some interest in combinatorics, in the area of random graphs. These graphs are also called multiply rooted graphs.:455
The terms rooted directed graph or rooted digraph also see variation in definitions. The obvious transplant is to consider a digraph rooted by identifying a particular node as root.:307 However, in computer science, these terms commonly refer to a narrower notion, namely a rooted directed graph is a digraph with a distinguished node r, such that there is a directed path from r to any node other than r.:122:524:308 Authors which give the more general definition, may refer to these as connected (or 1-connected) rooted digraphs.:307
The Art of Computer Programming defines rooted digraphs slightly more broadly, namely a directed graph is called rooted if it has at least one node that can reach all the other nodes; Knuth notes that the notion thus defined is a sort of intermediate between the notions of strongly connected and connected digraph.
In computer science, rooted graphs in which the root vertex can reach all other vertices are called flow graphs or flowgraphs. Sometimes an additional restriction is added specifying that a flow graph must have a single exit (sink) vertex as well.:319
Flow graphs may be viewed as abstractions of flow charts, with the non-structural elements (node contents and types) removed. Perhaps the best known sub-class of flow graphs are control flow graphs, used in compilers and program analysis. An arbitrary flow graph may converted to a control flow graph by performing an edge contraction on every edge that is the only outgoing edge from its source and the only incoming edge into its target. Another type of flow graph commonly used is the call graph, in which nodes correspond to entire subroutines.
The general notion of flow graph has been called program graph, but the same term has also been used to denote only control flow graphs. Flow graphs have also been called unlabeled flowgraphs, and proper flowgraphs. These graphs are sometimes used in software testing.
When required to have a single exit, flow graphs have two properties not shared with directed graphs in general. Flow graphs can be nested, which is the equivalent of a subroutine call (although there is no notion of passing parameters), and flow graphs can also be sequenced, which is the equivalent of sequential execution of two pieces of code.:323 Prime flow graphs are defined as flow graphs that cannot be decomposed via nesting or sequencing using a chosen pattern of subgraphs, for example the primitives of structured programming.:339 Theoretical research has been done on determining, for example, the proportion of prime flow graphs given a chosen set of graphs.
Peter Aczel has used rooted directed graphs in which the whole graph is reachable from the root (which he calls accessible pointed graphs) to formulate Aczel's anti-foundation axiom in non-well-founded set theory. In this context, the vertices of a graph model sets within the set theory, and their adjacency relation models the relation of one set belonging to another. The anti-foundation axiom states that every accessible pointed graph models a family of sets in this way.
A special case of interest are rooted trees, the trees with a distinguished root vertex. If the directed paths from the root in the rooted digraph are additionally restricted to be unique, then the notion obtained is that of (rooted) arborescence—the directed-graph equivalent of a rooted tree. A rooted graph contains an arborescence with the same root if and only if the whole graph can be reached from the root, and computer scientists have studied algorithmic problems of finding optimal arborescences.
- Daniel Zwillinger (2011). CRC Standard Mathematical Tables and Formulae, 32nd Edition. CRC Press. p. 150. ISBN 978-1-4398-3550-0.
- Harary, Frank (1955), "The number of linear, directed, rooted, and connected graphs", Transactions of the American Mathematical Society 78: 445–463, doi:10.1090/S0002-9947-1955-0068198-2, MR 0068198
- Jonathan L. Gross; Jay Yellen; Ping Zhang (2013). Handbook of Graph Theory, Second Edition. CRC Press. pp. 764–765. ISBN 978-1-4398-8018-0.
- Joel Spencer (2001). The Strange Logic of Random Graphs. Springer Science & Business Media. chapter 4. ISBN 978-3-540-41654-8.
- Björner, Anders; Ziegler, Günter M. (1992), White, Neil, ed., "Matroid Applications", Matroid applications, Encyclopedia of Mathematics and its Applications (Cambridge: Cambridge University Press) 40: 284–357, doi:10.1017/CBO9780511662041.009, ISBN 0-521-38165-7, MR 1165537, Zbl 0772.05026
- Ramachandran, Vijaya (1988). "Fast Parallel Algorithms for Reducible Flow Graphs". Concurrent Computations: 117–138. doi:10.1007/978-1-4684-5511-3_8.
- Okamoto, Yoshio (2003). "The forbidden minor characterization of line-search antimatroids of rooted digraphs". Discrete Applied Mathematics 131 (2): 523–533. doi:10.1016/S0166-218X(02)00471-7.
- Abhinandan Jain (2010). Robot and Multibody Dynamics: Analysis and Algorithms. Springer Science & Business Media. p. 136. ISBN 978-1-4419-7267-5.
- Chen, Xujin (2004). "An Efficient Algorithm for Finding Maximum Cycle Packings in Reducible Flow Graphs". Lecture Notes in Computer Science: 306–317. doi:10.1007/978-3-540-30551-4_28.
- Knuth (1997). The Art Of Computer Programming, Volume 1, 3/E. Pearson Education. p. 372. ISBN 0-201-89683-4.
- Norman Elliott Fenton; Gillian A. Hill (1993). Systems Construction and Analysis: A Mathematical and Logical Framework. McGraw-Hill. ISBN 978-0-07-707431-9.
- Horst Zuse (1998). A Framework of Software Measurement. Walter de Gruyter. pp. 32–33. ISBN 978-3-11-080730-1.
- Angelina Samaroo; Geoff Thompson; Peter Williams (2010). Software Testing: An ISTQB-ISEB Foundation Guide. BCS, The Chartered Institute. p. 108. ISBN 978-1-906124-76-2.
- Peri L. Tarr; Alexander L. Wolf (2011). Engineering of Software: The Continuing Contributions of Leon J. Osterweil. Springer Science & Business Media. p. 58. ISBN 978-3-642-19823-6.
- Pankaj Jalote (1997). An Integrated Approach to Software Engineering. Springer Science & Business Media. p. 372. ISBN 978-0-387-94899-7.
- K. Thulasiraman; M. N. S. Swamy (1992). Graphs: Theory and Algorithms. John Wiley & Sons. p. 361. ISBN 978-0-471-51356-8.
- Alejandra Cechich; Mario Piattini; Antonio Vallecillo (2003). Component-Based Software Quality: Methods and Techniques. Springer Science & Business Media. p. 105. ISBN 978-3-540-40503-0.
- Lowell W. Beineke; Robin J. Wilson (1997). Graph Connections: Relationships Between Graph Theory and Other Areas of Mathematics. Clarendon Press. p. 237. ISBN 978-0-19-851497-8.
- Cooper, C. (2008). "Asymptotic Enumeration of Predicate-Junction Flowgraphs". Combinatorics, Probability and Computing 5 (3): 215. doi:10.1017/S0963548300001991.
- Aczel, Peter (1988), Non-well-founded sets. (PDF), CSLI Lecture Notes 14, Stanford, CA: Stanford University, Center for the Study of Language and Information, ISBN 0-937073-22-9, MR 0940014
- Drescher, Matthew; Vetta, Adrian (2010), "An Approximation Algorithm for the Maximum Leaf Spanning Arborescence Problem", ACM Trans. Algorithms 6 (3): 46:1–46:18, doi:10.1145/1798596.1798599.
- Godsil, C. D.; McKay, B. D. (1978), "A new graph product and its spectrum" (PDF), Bull. Austral. Math. Soc. 18 (1): 21–28, doi:10.1017/S0004972700007760, MR 0494910
- McMahon, Elizabeth W. (1993). "On the greedoid polynomial for rooted graphs and rooted digraphs". Journal of Graph Theory 17 (3): 433–442. doi:10.1002/jgt.3190170316.
- Gordon, Gary (2001). "A characteristic polynomial for rooted graphs and rooted digraphs". Discrete Mathematics 232 (1-3): 19–33. doi:10.1016/S0012-365X(00)00186-2.