• Tidak ada hasil yang ditemukan

C omponents

Dalam dokumen Networks Second Edition (Halaman 146-150)

important in communication networks such as the Internet, where they affect how rapidly it is possible to get data from one node to another, or in transporta- tion networks such as airline networks, where they determine how many legs will be required for a particular journey.

It is possible for there to be no shortest path between two nodes if the nodes are not connected together by any route through the network (i.e., if they are in different “components”—see Section 6.12). In this case one sometimes says

Any self-intersecting walk must necessarily contain at least one loop (top), and hence can be shortened by removing the loop (bot- tom).

that the distance between the nodes is infinite, although this is mostly just convention—it doesn’t really mean very much beyond the fact that the nodes are not connected.

Shortest paths are necessarily self-avoiding, which is why we call them paths. (Recall that a path means a self-avoiding walk.) If a walk intersects itself then it contains a loop and can be shortened by removing that loop while still connecting the same start and end points (see figure), and hence self-intersecting walks are never the shortest route between any two nodes.

i j

Figure 6.12: There are three shortest paths between nodesiandjin this net- work, each of length three.

Shortest paths are not necessarily unique, however. It is perfectly possible to have two or more paths of equal length between a given pair of nodes. The paths may even overlap along some portion of their length—see Fig. 6.12.

Thediameterof a network is the length of the “longest shortest path.” That is, among all shortest paths between every pair of nodes in the network for which a path actually exists, the diameter is the length of the longest one.19 The diameter of the network in Fig. 6.12, for example, is three. The diameter will play a role, for instance, in our proof of the small-world effect for the random graph model in Section 11.7: we will show that the diameter of the network is small in a certain sense, from which it follows that the shortest distance between every pair of nodes is also small (provided the nodes are connected at all).

6.12 C

omponents

A network need not consist of just a single connected set of nodes. Many networks have two or more separate parts that are disconnected from one

19If the diameter were merely the length of the longest shortest path then it would be formally infinite in a network with more than one component if we adopted the convention above that nodes connected by no path have infinite distance. One can, however, talk about the diameters of the individual components separately, this being a perfectly well-defined concept whatever convention we adopt for unconnected nodes.

another. For example, the network shown in Fig. 6.13 is divided into two parts, the one on the left having three nodes, the one on the right having four. Such parts are calledcomponents. There is by definition no path between any pair of nodes in different components. In Fig. 6.13, for instance, there is no path from the node labeled A to the node labeled B.

A

B

Figure 6.13: A network with two com- ponents. There is no path between nodes like A and B that lie in different components.

Technically, a component is a subset of the nodes of a network such that there exists at least one path from each member of that sub- set to each other member, and such that no other node in the network can be added to the subset while preserving this property. (Subsets like this, to which no other node can be added while preserving a given property, are calledmaximal subsets.) A singleton node that is connected to no others is considered to be a component of size one, and every node belongs to exactly one component. A network in which all nodes belong to the same single component is said to be connected. Conversely, a network with more than one component is disconnected.

The adjacency matrix of a network with more than one component can be written in block diagonal form, meaning that the non-zero elements of the matrix are confined to square blocks along the diagonal of the matrix, with all other elements being zero:

A

©

­

­

­

­

­

­

­

­

«

0 · · ·

0 · · ·

... ... ...

ª

®

®

®

®

®

®

®

®

¬

. (6.26)

Note, however, that the node labels must be chosen correctly to give this form.

The appearance of blocks in the adjacency matrix relies on the nodes of each component being given sequential labels so that they are grouped together along the axes of the matrix. If the nodes are not grouped in this way the matrix will not be block diagonal and it may be difficult to tell that the network has separate components. There do, however, exist computer algorithms, such as the breadth-first search algorithm described in Section 8.5, that can take a network with arbitrary node labels and quickly determine its components.

6.12.1 Components in directed networks

For directed networks the definition of components is more complicated. The situation is worth looking at in some detail, because it assumes some practi-

6.12 | C

omponents

Figure 6.14: Components in a directed network.This network has two weakly connected components of four nodes each, and five strongly connected com- ponents (shaded).

cal importance in networks like the World Wide Web. Consider the directed network shown in Fig. 6.14. If we ignore the directed nature of the edges, considering them instead to be undirected, then the network has two compo- nents of four nodes each. In the jargon of graph theory these are calledweakly connected components. Two nodes are in the same weakly connected component if they are connected by one or more paths through the network, where paths are allowed to go either way along any edge.

In many practical situations, however, this is not what we care about. For example, the edges in the World Wide Web are directed hyperlinks that allow web users to surf from one page to another, but only in one direction. This means it is possible to reach one web page from another only if there is a directed path between them, i.e., a path in which we follow edges only in the forward direction. It would be useful to define components for directed networks based on such directed paths, but this raises some problems. It is

A B

There is a directed path from A to B in this network, but none from B to A.

possible for there to be a directed path from node A to node B but no path back from B to A. Should we then consider A and B to be connected? Are they in the same component or not?

There are various answers one could give to these questions. One possibility is that we define A and B to be connected if and only if there exists a directed path both from A to B and from B to A. In that case, A and B are said to be strongly connected. We can define components for a directed network using this definition of connection and these are calledstrongly connected components.

Technically, a strongly connected component is a maximal subset of nodes such that there is a directed path in both directions between every pair in the subset.

The strongly connected components in the network of Fig. 6.14 are indicated by the shaded regions.

Strongly connected components can consist of just a single node (there are three such components in Fig. 6.14) and every node belongs to exactly one strongly connected component. Note also that every strongly connected component with more than one node must contain at least one cycle. Indeed every node in such a component must belong to at least one cycle, since there is by definition a directed path from that node to every other in the component and a directed path back again, and the two paths together make a cycle. (A

corollary of this observation is that directed acyclic graphs have no strongly connected components with more than one node, since if they did they wouldn’t be acyclic.)

Figure 6.15: In- and out-components.

The two shaded regions denote the in- and out-components of node A in this small directed network. The overlap be- tween the two regions is A’s strongly connected component.

Strongly and weakly connected components are not the only use- ful definitions of components in a directed network. On the Web it could be useful to know what pages you can reach by surfing from a given starting point, but you might not care so much whether it’s possible to surf back the other way. Considerations of this kind lead us toout-components: an out-component is the set of nodes that are reachable via directed paths starting from a specified node A, and including A itself—see Fig. 6.15.

The members of an out-component depend on the choice of the starting node. Choose a different starting node and the set of reach- able nodes may change. Thus an out-component is a property of both the network structure and the starting node, and not (as with strongly and weakly connected components) of the network structure alone.

This means, among other things, that a node can belong to more than one different out-component. In Fig. 6.16, for instance, we show the out-components of two different starting nodes, A and B. Nodes X and Y belong to both.

A few other points are worth noticing. First, it is self-evident that all the members of the strongly connected component to which node A belongs are also members of A’s out-component. Further- more, any node that is reachable from A is necessarily also reachable from all the other nodes in the strongly connected component. Thus it follows that the out-components of all members of a strongly connected component are identical. It would be reasonable, therefore, to say that out-components really

“belong” not to individual nodes, but to strongly connected components.

Note also that while an out-component can have edges to other nodes—

nodes not in the out-component—such edges only ever point inward towards the component and never outward (see Fig. 6.16 again for examples). If they pointed outward then the nodes they connected to would by definition be members of the out-component.

Analogous ideas apply also to the nodesfrom whicha particular node can be reached. The in-component of a specified node A is the set of all nodes from which there is a directed path to A, including A itself (see Fig. 6.15).

In-components depend on the choice of the specified node and a node can belong to more than one in-component. But all nodes in the same strongly connected component have the same in-component, and the strongly connected component to which a node belongs is a subset of its in-component. Indeed any

Dalam dokumen Networks Second Edition (Halaman 146-150)