1 Our contributions and related work
Reeb graphs are used in image analysis [1] as simple representations of shapes. The Reeb graph is an abstract graph that describes the linking structure of connected components in level sets of a real-valued function on a complex. Briefly, a complex is a union of vertices, edges, triangles, tetrahedra and so on. Formal Definition 2.5 of a Reeb graph in section 2 doesn’t specify any canonical way to visualize this abstract graph in a low dimensional space.
Problem 1.1.
Is it possible to canonically embed (draw without any self-intersections) and encode any general Reeb graph in a low-dimensional space?
Here we briefly introduce auxiliary concepts, see all definitions in sections 2-3. A cycle in a graph is independent of other cycles if (briefly) and every edge of is covered twice. For instance, the theta-graph has two independent cycles (small loops) whose union covers the large cycle once and the middle arc twice. In general, multiple arcs between the same nodes generate independent cycles.
Embedding Theorem 1.2 requires a Reeb graph simplified by all steps:
(1) forget about every node of degree 2 and then merge its two arcs;
(2) replace all multiple arcs between the same nodes by a single arc;
(3) remove any subtree (a subgraph without cycles), but keep its root.
Let be the star graph with rays. Then is a book with pages.
Theorem 1.2.
Let a Reeb graph have at most independent cycles with a common arc. If a simplified Reeb graph has nodes, then the original Reeb graph can be canonically embedded into the book .
The embedding in Theorem 1.2 is canonical in the sense that different embeddings of the same graph can be continuously deformed to each other. In a book embedding of a Reeb graph, all nodes lie in the binding axis of the book and each arc lies in a single page. A book embedding can be linearly encoded, so we may work with easy codes instead of abstract Reeb graphs.
Almost all results about book embedding focus on undirected graphs when nodes can lie in any order in the binding axis. There is a linear time algorithm to embed any planar graph in 4 pages [12]. A general undirected graph with nodes can be embedded in pages [3]. We could find results on book embeddings (stack layouts) of general directed acyclic graphs only for a small number of pages [6]. The full version of Theorem 1.2 in section 4 extends [6, Theorem 2.3], where any graph with only one cycle is embedded into 2 pages. In section 5 we review other work on computing Reeb graphs.
2 Simplicial complexes and their Reeb graphs
Definition 2.1.
A simplicial complex is a finite set of vertices and a collection of subsets called simplices such that all subsets of a simplex are also simplices. The dimension of a simplex is . The dimension of a complex is the highest dimension of all its simplices. Any simplex inherits the Euclidean topology from this geometric realization:
Then we can define the topology on any simplicial complex by gluing all its simplices along their common subsimplices, so we glue along .
Definition 2.2.
The Euler characteristic of a simplicial complex is the alternating sum , where is the number of -dimensional simplices of . The sum is finite as consists of finitely many simplices.
Definition 2.3.
Two maps are homotopic if there is a continuous map , such that and for any , so are connected by a continuous family of maps , . Two simplicial complexes have the same homotopy type (are homotopy equivalent) if there are continuous functions and such that and are homotopic to the corresponding identity maps and .
We remind the classical result that is a homotopy invariant of .
Proposition 2.4.
If simplicial complexes have the same homotopy type, then , so the Euler characteristic is a homotopy invariant.
Let be a simplicial complex with a piecewise linear function . We assume that is given by its real values at all vertices of . We consider only generic functions that have distinct values at all vertices. Otherwise we symbolically perturb the values of by replacing the test with the test [11, p. 253]. Then we linearly extend to any simplex (hence to the whole simplicial complex ) spanned by vertices as follows: , where all and .
Definition 2.5.
Let a simplicial complex have a piecewise-linear function given by distinct values at all vertices of . The Reeb graph is the quotient of , where we collapse each connected component of to a single point. Different connected components are collapsed to different points. Any point represents a connected component of and has the associated value . Then we have the associated function .
A value is called regular if all level sets have the same number of connected components over a small interval . Otherwise the value is critical. A point in is a Reeb node if the corresponding level set component passes through a critical value of .
An arc of is a pair of nodes ordered by their values . If has multiple arcs between the same nodes , then the pair is repeated times in the full set of arcs. We call vertices and edges of nodes and arcs, respectively, to avoid a confusion with vertices and edges of a simplicial complex. Later we shall embed all arcs of as curved (often circular) arcs in a multi-page book.
Definition 2.5 implies that has only Reeb nodes of degree 1 or at least 3, no nodes of degree 2. However, if we monitor not only connected components of a level set , but also the Euler characteristic, then we need to add (topologically trivial) nodes of degree 2 to when the Euler characteristic or (more generally) any Betti number of changes.
Definition 2.6.
A point is called an Euler node of degree 2, if the corresponding level set component changes its Euler characteristic when passing through the value . Then every arc in the new Euler-Reeb graph has the associated Euler characteristic.
The middle picture in Fig. 1 shows for a torus with a bubble. The bubble generates the arc with the associated Euler characteristic , where the theta-graph is a component in a level set .
Definition 2.7.
A point is called a Betti node of degree 2, if the corresponding level set component changes one its Betti numbers , , when passing through the value . Each is the rank of the -th homology group of Every arc in the new Betti-Reeb graph has the associated array of Betti numbers .
The right-hand side picture in Fig. 1 shows . The bubble in gives a component (two tori attached along an annulus) whose Betti numbers are (two meridians, one common longitude) and .
3 Multi-page book embeddings of graphs
Definition 3.1.
An undirected cycle in a graph is a sequence of distinct nodes such that any nodes are connected by an arc, where and . A directed acyclic graph (DAG) is a graph with oriented arcs, but without directed cycles of consistently oriented arcs.
Each undirected cycle in can be considered as a formal sum of its arcs (with coefficients in if we forget about orientations). Several cycles of are called independent
if their formal sums are linearly independent in the vector space spanned by all arcs (say with coefficients in
for simplicity).Embedding Theorem 1.2 uses the maximum number of independent undirected cycles that share a common arc. If cycles of meet only at nodes or if all cycles are disjoint, they don’t share any arcs, so . The graph consisting of arcs connecting 2 nodes has independent cycles , , which share , hence .
Lemma 3.2.
Any directed acyclic graph has an ordering of nodes consistent with orientations of arcs, namely any arc is oriented from a smaller node to a larger node. Any Reeb graph is a directed acyclic graph.
Proof.
We can uniquely choose the partial ordering: a node is smaller than if there is a path of consistently oriented arcs from to . Then we may arbitrarily decide which of any two non-comparable nodes is larger. In we orient an arc from to if . ∎
Definition 3.3.
A function between simplicial complexes is called an embedding if is a homeomorphism on image, namely the restriction is bijective and bi-continuous (in both directions).
Definition 3.4.
For any integer , if we attach edges (rays) to one vertex (center), we get the star graph . The product is called the -page book. The vertical axis is called the binding axis (or the spine). For each edge , the product is a page of , see Fig. 2.
Definition 3.5.
An embedding of a directed acyclic graph into the book is called a book embedding if the following properties hold:
the nodes-in-axis property: all nodes of lie in the binding axis ;
the directional property: any arc has the same direction as the axis ;
the arc-in-one-page property: any arc is within a single page of .
The right hand side picture of Fig. 2 shows a book embedding . The properties from Definition 3.5 allow us to encode a book embedding by listing all edges (say, in the increasing order of their lowest node) and by specifying the index of the page containing each arc. Fig. 1 shows more optimal embeddings of , , not book embeddings.
Definition 3.6.
Number nodes of a Reeb graph by . Then a book embedding has the code of pairs , where are nodes connected by an arc in the -th page. We may also include labels, e.g. means that the arc has the associated Euler characteristic . Pairs of nodes can be lexicographically ordered if we need a unique code.
4 Embeddings of directed acyclic graphs
We were initially motivated by embeddings of Reeb graphs. However, all results in this section work for more general directed acyclic graphs.
Definition 4.1.
A directed acyclic graph is called a tree if has no cycles even after forgetting all orientations. A root of is a node of degree 1.
Lemma 4.2.
Any directed acyclic tree with a root can be embedded into the upper half-disk for any in such a way that the root goes to the origin , all other nodes lie in the diameter on the -axis and all arcs have the direction of the -axis.
Proof.
We prove by induction on the number of nodes. The base is trivial. In the inductive step we may assume that the only arc at the root of is oriented from to another node . Then we shall embed into the positive half-disk with the center and radius . If the arc is oriented from to , the symmetric construction gives a required embedding into the negative half-disk with the center and radius .
We embed the arc as a curved arc such that the root goes to the origin and the node goes to the center of the upper half-disk. If we remove the arc , the given tree splits into smaller subtrees with the root . By the inductive assumption each subtree can be embedded into a small half-disk to the left or to the right of the center . Fig. 3 shows yellow half-disks with similarly embedded tripods. Let the node have ordered neighbors . We embed the subtrees of one by one starting from the lowest neighbor . We embed every next subtree into an even smaller half-disk between and the previous subtree. We similarly embed subtrees with higher neighbors of starting from the highest. ∎
Any undirected graph with nodes has a book embedding into pages [3]. In Lemma 4.3 we embed a directed acyclic graph with an extra property that allows us to add later nodes of degree 2 and re-embed any arc in the same page by putting all new nodes into the binding axis .
Lemma 4.3.
Any directed acyclic graph with ordered nodes has a canonical book embedding such that this extra property holds:
the access-to-axis property: the projection to of any arc contains a small interval not covered by the projections of other arcs in the same page.
Proof.
We construct a required embedding by induction on the number of nodes , which can be ordered by Lemma 3.2. In the base case we embed as shown in Fig. 2. In the inductive step from to , we take the -st highest node and embed the subgraph of on lower nodes by the inductive assumption.
Then we embed all arcs at into the extra -st page of the larger book as curved arcs connecting to lower nodes, so we avoid any self-intersections. The embedding depends only on the order of nodes in the binding axis. If we deform the nodes keeping their order, then we can continuously deform the embedded graph within the book . ∎
Definition 4.4.
The core subgraph is obtained from a directed acyclic graph in several stages where each stage consists of these steps:
Step (1): forget about any degree 2 node and merge its two arcs into one;
Step (2): replace all multiple arcs between the same nodes by a single arc;
Step (3): remove any subtree attached to a node and keep the node .
At each simplification stage we apply step (1), then (2), finally (3) before moving to the next stage when we again apply (1), (2), (3) and so on.
We have actually introduced the ascending filtration of the subgraphs when was simplified to through stages. Namely, is obtained from in one stage by following Step (1), then Step (2), finally Step (3), .
In fact has only nodes of degree at least and can be considered as a subgraph of . So the smallest core (except a single point) is .
For the Euler-Reeb graph of the torus with a bubble in Fig. 1 at the first stage we (1) forget about two nodes of degree 2, (2) replace a new double arc by a single arc, (3) simplify the resulting 3-arc path to a single point.
In practice, the Reeb graph may have few cycles, because any noise in original data usually leads to short edges or trivial nodes of degree 2 that are not included in the core of the graph . So the core of a Reeb graph is usually small, which leads to embeddings into small books.
Definition 4.5.
For any arc in the subgraph of a directed acyclic graph , we introduce the edge-subgraph that was collapsed to (replaced by) the arc in the simplification process from Definition 4.4. To make unique, we order all nodes of by Lemma 3.2 and order all arcs with the same endpoints. Let be a tree that was attached to a node and was removed in Step (3). We include into for the first arc from the root of to the next node in the fixed order of nodes.
To clarify Definition 4.5, we reverse all steps of the last simplification stage from to . If in Step (3) we removed a subtree attached to a node , then we include into the edge-subgraph for a unique edge at . If in Step (2) we replaced multiple arcs with the same nodes by the single arc , then contains all these arcs, so is blown up times. If in Step (1) we forgot about a degree 2 node in the arc , then we simply add this node to . After reversing the last simplification stage, we got a larger graph . Now can start building for any new arc . After reversing all stages of Definition 4.5 we have constructed a unique edge-subgraph for any arc .
A book embedding restricted to a single page is a union of disjoint curved arcs with nodes in the binding axis . These arcs split the page into intermediate areas, see the yellow area below the arc in Fig. 4.
Lemma 4.6.
Let a directed acyclic graph have at most independent cycles with a common arc. Let be a book embedding from Lemma 4.3. By the access-to-axis property, for any arc , let be the union of intervals not covered by the projections of other arcs in the same page as . Let be the open area bounded by , and all arcs of connecting the endpoints of and . Let the holed book consist of copies of attached along , see the first picture in Fig. 5. Then there is a book embedding .
Proof.
Similarly to the discussion after Definition 4.5, we shall embed by reversing all simplification stages from Definition 4.4. Formally we shall argue by induction on the number of stages. If , then is already embedded. In the inductive step for the last simplification stage we use embeddings of smaller edge-subgraphs built in fewer stages.
Case of Step (3). Let the arc have endpoints and have a tree attached at . By Definition 4.5 the node is the next adjacent node to . Hence is the lowest arc (closest to the binding axis ) among all arcs at in the same page. So the open area looks like a half-disk bounded by with the diameter in the binding axis, see the second picture in Fig. 5. We embed into this half-disk by Lemma 4.2.
Case of Step (2). Let contain multiple arcs that were replaced by the arc between nodes . These multiple arcs generate independent cycles sharing . In the simplest case and we embed each of arcs one per page (as rotational copies of ) into the book with pages, see the third picture in Fig. 5.
In general, is the union of all subgraphs , , built on the arcs by reversing earlier simplification stages. If each arc is shared by at most independent cycles in , then we need extra pages to embed by the inductive assumption. So in total we need extra pages for embedding all subgraphs . However, all these independent cycles from give the same number of independent cycles that share the arc in .
Indeed, let each of these cycles contain an arc , see the last picture in Fig. 5. If are extreme nodes (according to their order) in such a cycle , we can replace by the larger cycle going through (from to ), then along (from to ) following the original cycle through the nodes and , but avoiding . Then all new cycles are independent in and share the same subarc in as all cycles from , . So we have enough pages to embed .
Case of Step (1). Let have nodes of degree 2 on the arc between nodes . Then we re-embed in the same page by putting all new nodes into . See Fig. 4 for two nodes . To make this embedding caninical, we may put all into the first interval from (possibly disconnected) between and the next node in . ∎
General version of Embedding Theorem 1.2. Let a directed acyclic graph have at most independent cycles that share a common arc. If has nodes, then has a book embedding in .
Proof.
If is not a single node, then and we take a book embedding from Lemma 4.3. If is a single node, then we set , so for simplicity. Then is the union of the subgraphs from Definition 4.5 over all arcs . The open areas from Lemma 4.6 are disjoint over all arcs in the same page of . Hence the union of the holed books over all from one page of are disjoint in the blown-up -page book. For all arcs in one page, we can jointly embed into the disjoint union of the holed books by Lemma 4.6, hence into the same pages. So each page of the book generates more pages and the whole graph is embedded into . ∎
If we would like to canonically embed all Reeb graphs into a fixed book, we may choose a star graph with infinitely many edges consisting of the radii of the unit circle to the points , .
5 Discussion and further open problems
Trivial nodes of degree 2 in Reeb graphs and do not create any problem for encoding book embeddings. Indeed, we may encode a path between any nodes of degree not equal to 2 by a linear sequence of arcs with all necessary labels. All extra nodes of degree 2 in Reeb graphs have no attached subtrees. Then we may leave all multiple arcs between the same nodes in one page. For instance, the Euler-Reeb graph for a torus with a bubble in Fig. 1 can be encoded by the array of arcs , where are ordered nodes and the subscript highlights only 1 page. One of the arcs between nodes and splits into 3 subarcs with the associated Euler characteristics .
If we drop the requirement for a book embedding in Definition 3.5 that all nodes of degree 2 in Reeb graphs lie in the binding axis, then we strengthen Theorem 1.2 and get optimal embeddings into a 1-page book as in Fig. 1.
Corollary 5.1.
The number of independent cycles in Corollary 5.1 is smaller for a Reeb graph than in general Theorem 1.2, because may lose multiple arcs after Steps (1) and (2) of the first simplification stage of Definition 4.4. So the number cycles is now counted for a graph simpler than . For instance, the Euler-Reeb graph for a torus with a bubble in Fig. 1 initially has (one cycle). However is simplified to a single node in one stage, so in Corollary 5.1 gives an embedding .
The problem to find the minimum page number such that a directed acyclic graph has a book embedding into is NP-complete [7]. Our key result is an algorithmic method to embed any directed acyclic graph into a small book, which gives a practical upper bound for . The following problem is the next step for automatic processing Reeb graphs.
Problem 5.2.
Design a fast algorithm to compute a book embedding for a given directed acyclic graph, hence compute a linear code for any Reeb graph.
Different shapes may have identical Reeb graphs. The ultimate aim is to design a shape descriptor that uniquely represents geometric objects up to a natural equivalence. We start from the homotopy equivalence on complexes.
Problem 5.3.
In addition to Betti numbers on edges of a Reeb graph, find extra invariants that would enable us to reconstruct a simplicial complex up to (say) a homotopy equivalence from the given graph .
It is interesting to translate transformations of time-varying Reeb graphs [2] into codes of book embeddings. The algorithm [4, 5, 10] for computing the classical Reeb graph
can probably be adapted for computing the Euler-Reeb graph. For 3-dimensional scalar fields
[11] when level sets are 2-dimensional isosurfaces, all Betti numbers from were found without increasing the overall computational complexity.Problem 5.4.
For a given simplicial complex with a real-valued function, compute the Reeb graph with all extra invariants needed for Problem 5.3.
We are open to collaboration on the above (and any related) problems. We thank in advance any reviewers for critical comments and suggestions.
References
- [1] S. Biasotti, D. Giorgi, M. Spagnuolo, B. Falcidieno. Reeb graphs for shape analysis and applications. Theor. Comp. Sci. 392 (2008) 5-22.
- [2] H. Edelsbrunner, J. Harer, A. Mascarenhas, V. Pascucci, J. Snoeyink. Time-varying Reeb graphs for continuous space-time data. Computational Geometry 41 (2008), 149-166.
- [3] Y.-C Chen, H.-L. Fu, I.-F. Sun. Embedding graphs in books: a layout problem with applications to VSLI design. SIAM J. Algebraic Discrete Methods 8 (1987) 33-58.
- [4] H. Doraiswamy, V. Natarajan. Output-Sensitive Construction of Reeb Graphs. IEEE Transactions on Visualization and Computer Graphics 18 (2012) 146-159.
- [5] W. Harvey, Y. Wang, R. Wenger. A randomized time algorithm for computing Reeb graphs of arbitrary simplicial complexes. In Proceedings of SoCG 2010, 267-276.
- [6] L. Heath, S. Pemmaraju, A. Trenk. Stack and Queue Layouts of Directed Acyclic Graphs. Part I. SIAM J. Comp., 28, 1510-1539, 1999.
- [7] L. Heath, S. Pemmaraju. Stack and Queue Layouts of Directed Acyclic Graphs. Part II. SIAM J. Comp., 28, 1588-1626, 1999.
- [8] V. Kurlin. Basic embeddings into a product of graphs. Topology and Its Applications 102 (2000) 113-137.
- [9] V. Kurlin. Three-page encoding and complexity theory for spatial graphs. J Knot Theory Ramifications 16 (2007) 59-102.
- [10] S. Parsa. A deterministic time algorithm for the Reeb graph. In Proceedings of SoCG 2012, 269-276.
- [11] V. Pascucci, K. Cole-McLaughlin. Parallel computation of the topology of the level sets. Algorithmica 38 (2004) 249-268.
- [12] M. Yannakakis. Embedding planar graphs in four pages. J. Comput. System Sci. 38 (1986) 36-67.