This chapter sets the stage as it introduces graphs, collections of nodes or vertices linked by undirected edges or directed arcs. We will discuss two types of graphs: node-weighted graphs and edge-weighted graphs. Graphs are simple and abstract structures that are able to model all kinds of relations.
Node-weighted graphs may be used for modeling a topographic surface: the nodes represent positions in a domain. An edge between two nodes simply indicates that the corresponding positions are neighbors. The weights of the nodes express the altitude of the surface at the corresponding locations.
Edge-weighted graphs may be used for modeling the relations between the catchment zones of a topographic surface. Each catchment zone is represented by a node. Two catchment zones separated by a pass point are linked by a weighted edge, with the edge weight being the altitude of the pass point.
This interpretation of node- or edge-weighted graphs will be inspiring for operators which make sense when applied to a topographic surface. However, the same operators may take other interpretations if the graphs model other structures than topographic surfaces.
A path is a series of nodes such that two successive nodes are linked by an edge. The weights of the nodes or edges enable us to define flowing paths, followed by a drop of water deposited on a node. On a node-weighted graph, a drop of water may move from node p to node q, if the weight of q is not higher than the weight of p, as a drop of water never moves upwards. On an edge-weighted graph, there is no relative altitudes between nodes. A drop of water deposited on a node p quits this node through the lowest adjacent edge.
The remaining topographic concepts derive from these simple elementary motions of a drop of water between adjacent nodes.
In this chapter, we separately study the particular form taken by these topographical concepts for node-weighted and edge-weighted graphs. There are many similarities between the two types of graphs:
There are also some significant differences between the two types of graphs:
A graph G = [, ε] contains a set
of vertices or nodes and a set ε of edges; an edge being an unordered pair of vertices. The nodes are designated with small letters: p, q, r... The edge linking the nodes p and q is denoted by epq or by (p – q).
A directed graph, also called a digraph , contains a set
of vertices or nodes and a set
of arcs, an arc being an ordered pair of vertices.
Undirected edges are simply called edges, whereas directed edges are called arcs. If p and q are neighboring nodes, then (p – q) denotes an undirected edge, whereas (p → q) or (q → p) denotes directed arcs (also called arrows). If both arcs (p → q) and (q → p) exist, we write (p ↔ q) or (p ⇆ q) that consists of a bidirectional arrow.
For an undirected graph, the subgraph spanning a set A ⊂ is the graph GA = [A, εA], where εA are the edges linking two nodes of A: εA = {(p – q) ∈ ε | p, q ∈ A}.
For a directed graph , the subgraph spanning a set A ⊂
is the graph
, where
A are the arcs of
connecting two nodes of A :
or (q → p) or
.
The partial graph is associated with a subset
of edges. Its nodes are all nodes of
whose extremities are linked by an edge of
, where
.
The partial digraph is associated with a subset
of arcs. Its nodes are all nodes of
whose extremities are linked by an arc of
, where
or (q → p) or
.
A path, π, is a sequence of vertices and edges, interweaved in the following way: π starts with a vertex, say p, followed by an edge (p – q), incident to p, followed by the other endpoint q of epq, and so on.
A directed path, , is a sequence of vertices and arrows, interweaved in the following way: π starts with a vertex, say p, followed by an arrow (p → q) with origin p, followed by the arrowhead q of (p → q), and so on.
A cycle is a path whose origin and extremity coincide.
The cocycle of a set Y is the set of all edges with one extremity in a subset Y of the nodes and the other in the complementary set Ȳ:
The cocycle of a set Y is the set of all arrows with one extremity in a subset Y of the nodes and the other in the complementary set Ȳ:
We may distinguish between the outgoing cocycles where all arrows have their origin in Y and the incoming cocycles where all arrows have their arrowheads in Y.
Edges and/or nodes may be weighted with weights taken in a totally ordered set Ƭ. We define two families of functions:
The function takes the value ηpq on the edge epq of the graph G or on the arc
in
; the function
takes the weight νp on the node p in G and
.
Nodes and edges may hold weights or not. We will distinguish:
The first operator C is a decreasing involution or complementation. According to T, it takes the following two forms:
If T represents signed numbers, Cν = –ν for and Cη = –η for
.
If T = [0, K], then Cν = K – ν for and Cη = K – η for
.
To each operator , we assign a dual operator:
. And
for an operator
.
DEFINITION 4.1.– We define two operators between edge weights η and node weights ν:
LEMMA 4.1.– The four operators are two-by-two dual or adjoint operators.
PROOF.– Adjunction: Consider, for the same graph, an arbitrary function on the nodes and an arbitrary function
on the edges. Then,
. Duality: [εen(–ν)]ij = –νi ∧ –νj = –(νi ∨ νj) = –[δen ν]ij. Thus, δen ν = – [εen(–ν)].
□
By composition, we obtain the following operators:
By composition, we obtain the following operators:
As the functions ν, η and the functions produced by one of the above operators take all their values in T, a lattice on numbers, on which a subtraction exists, we may combine dilations and erosions to form gradient operators. These operators, first defined by Serge Beucher, are obtained by subtracting an erosion from a dilation. We may thus define Beucher Gradient operators:
In the context of the watershed and flooding theory, we will mostly use the flowing adjunction: (δen, εne) and the derived opening γe and closing φn. They nicely reveal the intrication of the node or edge weights with the graph structure itself.
For instance, if a node-weighted graph has no isolated regional minima, i.e. node with only higher neighbors, then the node weight function υ is invariant by the closing φn. On the contrary, if such nodes exist, their weight is increased by the closing φn as is illustrated in Figure 4.1. Figure 4.1 successively presents a node-weighted graph G(ν, nil), followed by the edge-weighted graph G(nil, δenν) and finally by G(φnν, nil). There is a node in the upper part of the graph with weight 1 which is an isolated regional minimum. The weight of this node is increased in the graph G(φnν, nil), whereas in all the other nodes, their weights are unchanged.
Figure 4.1. From left to right, a node-weighted graph G(ν, nil), the edge-weighted graph G(nil, δenν) and the node-weighted graph G(φnν, nil). The orange node on the right has its weight changed between G(ν, nil) and G(φnν, nil). For a color version of the figures in this chapter, see www.iste.co.uk/meyer/topographical1.zip
Similarly, if in an edge-weighted graph, each edge is the lowest adjacent edge of one of its neighbors, then the edge weight function is invariant by the opening γe. If this is not the case, the weight of such edges is lowered by the opening γe, as shown in Figure 4.2. Figure 4.2 presents an edge-weighted graph G(nil, η), followed by the node-weighted graph G(εneη, nil) and on the right the graph G(nil, γeη). The edge G(nil, γeη) whose weight has been lowered is highlighted by a red color. These edges are not the lowest edges of their extremities.
Figure 4.2. From right to left, an edge-weighted graph G(nil, η), the node-weighted graph G(εneη, nil) and on the right the graph G(nil, γeη). The red edges in the graph G(nil, γeη) have their weights lowered between the graphs G(nil, η) and the graph G(nil, γeη). These edges are not the lowest edges of one of their extremities
It will also be useful to attribute labels to the nodes. Typically, such labels serve to encode the various sub-structures extracted from the graph, for instance, for labeling the equivalence classes associated with equivalence relations defined on a graph. All nodes belonging to the same equivalence class share the same label. Serving for numbering and identifying structures, the labels are generally integers. Thus, the label function ϖ belongs to , the functions defined on the nodes
for a value of ℕ.
A topographic surface may be explored by following a drop of water deposited on its surface. By analogy, we will analyze and compare the “topography” of both edge-weighted or node-weighted graphs. This topography will be described by analyzing the trajectories followed by a drop of water moving from node to node.
For both types of graphs, node-weighted and edge-weighted, we define the elementary motions, a drop of water may follow from a node to the next one. An edge (p, q) is a flowing edge of a node p if a drop of water deposited at p is able to move to the node q.
Concatenating the flowing edges produces flowing paths. The flowing paths, in turn, serve to define regional minima, which are zones impossible to leave by following a flowing path. All nodes linked with a regional minimum by a flowing path form the catchment zone of this regional minimum.
We now precisely define the flowing edges, followed by a drop of water from node to node, highlighting the similarities and differences between the topographies of node-weighted and edge-weighted graphs.
We consider a node-weighted graph G(ν, nil).
We define a binary relation between neighboring nodes: p * q ⇔ νp = νq.
This relation is reflexive and symmetrical. Its transitive closure constitutes an equivalence relation . For p ≠ s, the relation p
s holds if a path linking p and s exists, whose nodes have the same weight. As the relation
is also symmetrical and reflexive, it is an equivalence relation.
DEFINITION 4.2.– The equivalence classes of ps are the flat zones of the graph.
DEFINITION 4.3.– A regional minimum of G(ν, nil) is a flat zone without lower neighboring nodes.
REMARK 4.3.– A node without a neighboring node with the same weight or a lower weight is an isolated regional minimum.
A drop of water may quit a node p, follow an edge epq and reach the node q iff the nodes p and q verify νp ≥ νq. This means that a drop of water never moves upwards.
DEFINITION 4.4.– The edge epq is a flowing edge of its extremity p iff νp ≥ νq.
Each edge of a node-weighted graph is a flowing edge of one of its extremities. Take the edge est, for instance. The edge est is a flowing edge of s if νs ≥ νt or of t if νt ≥ νs. If νt = νs, then est is a flowing edge of both its extremities.
DEFINITION 4.5.– A path p – epq – q – eqs – s… is a flowing path if each node except the last one is followed by one of its flowing edges.
It follows that the weights along a flowing path are never increasing: if p, q, s are three successive nodes on a flowing path, then νp ≥ νq ≥ νs.
LEMMA 4.2.– Any node outside a regional minimum is the first node of at least a flowing path leading to a regional minimum.
PROOF.– Take an arbitrary node p not belonging to a regional minimum. The node p has at least a neighboring node q which is lower or equal. If νq < νp, then p – epq – q is the beginning of a flowing path. If q itself does not already belong to a regional minimum, the reasoning applied to p may now be applied to the node q. If νq = νp, then p and q belong to a flat zone X which is not a regional minimum. X has a neighboring node with a lower weight: a pair of nodes s and t, exist s ∈ X, , verifying νs > νt. As X is a flat zone, a path π linking p and t exists inside X along which all nodes have the same weight. Concatenating the path π with the edge est produces a flowing path linking the node p with a lower node t. The same reasoning is then applied to the node s.
Thus, we construct a flowing path of origin p. Each step takes as input a flowing path ending with a node tk, and expands it into a new flowing path with a node tk+1 with a lower weight than tk. As the weights from tk to tk+1 are strictly decreasing, each step introduces at least one new node, never met before, into the flowing path. Since the number of nodes of the graph is finite, the process necessarily finishes inside a flat zone without lower neighbors, i.e. a regional minimum.
□
As any node is linked with at least one regional minimum, we may now define the catchment zone of a regional minimum.
DEFINITION 4.6.– The catchment zone of a regional minimum m is the set of nodes which are linked with a node inside m by a flowing path.
It results from the previous analysis that each node belongs to at least one catchment zone. It may, however, be linked by two flowing paths with two distinct regional minima, and thus belongs to two catchment zones, which overlap. Methods are presented in the following chapters for reducing the overlapping between catchment zones.
REMARK 4.4.– In the previous section, we defined p*q ⇔ νp = νq. This relation p*q may also be expressed using the flowing edges. For p ≠ q, we say that iff the edge epq is a flowing edge of both p and q. Indeed, νp = νq implies that epq is a flowing edge of p and of q. Inversely, if epq is a flowing edge of p, we have νp ≥ νq, and simultaneously, if it is a flowing edge of q, we have νq ≥ νp; both relations yielding νp = νq. In the case of node-weighted graphs, the relation p*q and
are thus equivalent. The relation
, however, is more general, as it may be associated with each definition of flowing edges. In the next section, we meet flowing edges defined on edge-weighted graphs. In the next chapter, we meet flowing edges on unweighted-directed graphs. In this case, the relation
holds if and only if (p ⇆ q).
REMARK 4.5.– This remark will be useful in the next chapter, in which we replace the flowing edges with directed arcs and study the topography of unweighted digraphs.
We now consider an edge-weighted graph G(nil, η) and analyze the trajectories that a drop of water may follow on such a graph.
We say that two edges are adjacent if they share a common extremity, as, for instance, the edges epq and eqr. We define a symmetrical relation between adjacent edges: epq ~ eqr ⇔ ηpq = ηqr.
This relation is reflexive (epq ~ epq) and symmetrical (epq ~ eqr ⇒ eqr ~ epq). Its transitive closure ≈ constitutes an equivalence relation between edges. The relation epq ≈ est holds if a path linking p and t exists along which all edges have the same weight.
DEFINITION 4.7.– The equivalence classes of the equivalence relation ≈ are the edge flat zones of the edge-weighted graph.
REMARK 4.6.– As equivalence classes of an equivalence relation are the edge flat zones disjoint. More precisely, they are “edge disjoint”, two such flat zones have no edge in common. However, they may have nodes in common. A node p may have two adjacent edges epq and eps with distinct weights, each of them belonging to a different edge flat zone.
DEFINITION 4.8.– A regional minimum of G(nil, η) is an edge flat zone without an adjacent edge with a lower weight.
A drop of water at a node p compares the weights of all edges to quit p, and follows one of the adjacent edges with the lowest weight.
DEFINITION 4.9.– An edge (p, q) is a flowing edge of the node p, if it is one of the lowest adjacent edges of p
In contrast to node-weighted graphs, in an edge-weighted graph, there may exist edges which are not flowing edges. Consider an edge est with a weight λ. If the nodes s and t have adjacent edges with lower weights than λ, then est is not a flowing edge. A drop of water deposited at s or t will never follow the edge est.
DEFINITION 4.10.– A path p – epq – q – eqs – s… is a flowing path if each node except the last one is followed by one of its flowing edges.
It follows that the weights of the successive edges in a flowing path are never increasing (if p, q and r are three successive nodes of a flowing path, then eqr is one of the lowest edges of q and thus epq ≥ eqr).
LEMMA 4.3.– Any node outside a regional minimum is the first node of a flowing path leading to a regional minimum.
PROOF.– Take an arbitrary node p not belonging to a regional minimum. Consider one of the edges with minimum weight linking this node with a node q. The path p – epq – q is a flowing path. If q belongs to a regional minimum, the lemma is verified. If not, we expand this path until reaching a regional minimum. We apply the same method to q and get the third node s and a path p – epq – q – eqs – s which is a flowing path. Again, if qs belongs to a regional minimum, the lemma is verified. If not and if ηqs < ηpq, the altitude of the path has decreased and we repeat the same process until a regional minimum is reached, which, as we will establish below, cannot fail to happen. If ηqs = ηpq, then p, q and s belong to a flat zone X which is not a regional minimum. If the internal edges of X have a weight equal to λ, and since X is not a regional minimum, X has an edge in its cocycle with a weight lower than λ: a pair of nodes r and t, exist r ∈ X, , verifying ηrt < λ. As X is a flat zone, a path π linking p and t exists inside X along which all edges have the same altitude. Concatenating the path π with the edge ert is a flowing path linking the node p with r, the last edge ert of this path having decreased. The same process is then applied to the node r and repeated. Ultimately, this process reaches a regional minimum. Indeed, both processing steps we just described construct a flowing path of origin p. Each step takes as input a flowing path and expands it into a new flowing one with a lower extremity. As the weights of these last edges are strictly decreasing, each step introduces at least one new edge, never met before, into the flowing path. Since the number of edges of the graph is finite, the process necessarily finishes inside a flat zone without a lower edge in its cocycle, i.e. a regional minimum.
□
As any node is linked with at least one regional minimum, we may now define the catchment zone of a node.
DEFINITION 4.11.– The catchment zone of a regional minimum m is the set of nodes which are linked with a node inside m by a flowing path.
It results from this analysis that each node belongs to at least one catchment zone. However, the same node may be linked by two flowing paths with two distinct regional minima, and thus belongs to two distinct catchment zones, which overlap. Later, we present methods for reducing the zones where catchment zones overlap, without modifying the initial edge or node weights. Instead, we edit the graph in order to reduce the number of flowing paths.
The second symmetrical relation, may be defined, this time between neighboring nodes. The relation is verified between the nodes p and q if the edge epq connecting them is a flowing edge for both. In other terms, epq is one of the lowest adjacent edges of p and of q :
.
REMARK 4.7.– We already met this same binary relation in the preceding section treating of node-weighted graphs, for which epq is a flowing edge of both its extremities p and q if and only if νp = νq.
We associate with the relation:
holding if a path linking p and s exists, such any two successive nodes u and υ on this path verify u
υ. This relation is transitive: if
and
, by concatenating the paths πps and πst along which the relation
holds, we obtain a path πpt along which
also holds.
By convention, we consider the relation to be reflexive:
. It is obviously symmetrical. It is thus an equivalence relation.
DEFINITION 4.12.– The equivalence classes of are called even zones of the edge-weighted graph.
If p, q, s verify p q and q
s, then
;
. It follows ηpq = ηqs.
The reverse implication is not true. If p, q, s are three nodes linked by edges whose weights verify ηpq = ηqs, it does not necessarily follow that p q and q
s. Indeed, any of the nodes p, q, s may have an adjacent edge with a lower weight than ηpq = ηqs. If, for instance, p has a neighboring node t verifying ηpt < ηpq, then the relation p
q is false.
PROPOSITION 4.1.– In a connected edge-weighted graph G(nil, η), an even zone impossible to quit by following a flowing path is a regional minimum of the graph.
PROOF.– We first remark that inside an even zone, all edges have the same weight. Suppose that a set of nodes X constitutes an even zone with weight λ, which is impossible to quit following a flowing edge. This means that if p ∈ X and epq is a flowing edge of origin p, then q also belongs to X and the edge eqp is also the lowest edge of q. The edges of X constitute a flat zone of the graph without adjacent lower edges, i.e. a regional minimum of G(nil, η).
□
REMARK 4.8.– We now have two characterizations of regional minima in edge-weighted graphs. The first one as edge flat zones, without outgoing flowing paths, concerns only edges. The second one considers even zones and concerns the nodes linked by bidirectional paths. They both have in common that no flowing paths exist, which makes it possible to quit a regional minimum. The second definition, based on even zones, will be generalized later to unweighted digraphs.
We have studied the topography of node-weighted graphs and edge-weighted graphs by considering the possible trajectories of a drop of water. We have considered all possible trajectories by excluding only trajectories where a drop of water moves upwards from a node to the next. An edge epq such that a drop of water may move from the node p to the node q is a flowing edge.
Flowing edges have been defined for both node- and edge-weighted graphs: the first is based on the node weights and the second is based on the edge weights. The flowing paths are then simply series of flowing edges, one flowing edge ending where the next starts. The major topographical structures of node- and edge-weighted graphs involve the paths.