Sometimes it is useful to count the links involved with an object. The indegree of an object is the number of incoming links. The outdegree of an object is the number of outgoing links. In Fig B the indegree of the object is 3 and the outdegree is 2. If the two outgoing links are removed then the object would have indegree = 3 and outdegree = 0. In this chapter there will be no objects with indegree = 0 and outdegree = 0 which are isolated objects.
The term "loop" has a special meaning when directed links are involved.
Each object in any loop has exactly one outgoing link to another object in the loop. Fig XXa and Fig XXb show such loops. Motion can start in any object and traverse the entire loop to return to the starting object.
But in Fig XXc and in Fig XXd there there is no loop. In each of those figures one object* has no outgoing link to another object in the collection. Motion cannot start and leave such an object* to visit another object in the collection.
Removal of any link in Fig XXa or Fig XXb produces a figure without a loop.
[3.1] (Digraph) A digraph is a graph with a finite number of objects and directed links.
In the Fig C is an unlabeled digraph with 6 objects. (Can the reader apply integer-names from N6 to the objects so that
The six objects in Fig C have been given integer-names as shown in Fig D. Then object 5 has indigree=1 and outdegree=2. Object 3 has indegree=1 and outdegree=2. Using only outgoing links it is possible to construct an adjacency array for this graph:
In a directed graph a path joining two objects is a sequence of objects between every pair of which is a directed link, except for the given objects. The first given object has a single outgoing link and the second given object has a single incoming link.
In a digraph the directed links may impose severe restrictions upon formation of any path. A link has been removed in Fig D to produce Fig. E. As a result, there still is path from object 2 to object 1, but no path from object 2 to object 3.
[1.2] (reachable objects) In a digraph a second object is reachable from a first object if there is a directed path from the first object to the second.
Objecct 1 is reachable from object 2, but object 3 is not reachable from object 2.
In Fig G object 1 is the source of water. It is desirable to send water to object 5 called the sink. There are two obvious, directed paths for the flow of water to travel. Along the upper path
The major topic in this section is to find the directed path from source to sink that allows maximum flow. This statement implies that the sink must be reachable from the source. Also the source has a positive outdegree. The sink is just the opposite, positive indegree. All this is independent of the labelling of the objects with integer-names. For example, Fig H is produced from Fig G by removing all labels on objects and assigning labels "source" and "sink." The maximum flow from source to sink along the upper path is 6 and along the lower path is 1.
The maximum flow going any way from source to sink is along the upper path because 6 > 1.
However, for use of the computer the labels are needed. In this chapter the optional labelling is to assign the source the integer-name 1, and the sink, the largest of all integer-names (n if there are n objects).