3

0

2

4

5

¥ ¡¢

D ¡T ©

The greedy multicoloring algorithm.

˜ 5)11zCY

In the above algorithm, the order has been arbitrarily selected for traversing

111 6 0 %

the nodes and coloring them. Instead, the nodes can be traversed in any order ,,

‘ !

. If a graph is bipartite, i.e., if it can be colored with two colors, then the algorithm will

¬nd the optimal two-color (Red-Black) ordering for Breadth-First traversals. In addition, if

a graph is bipartite, it is easy to show that the algorithm will ¬nd two colors for any traversal

which, at a given step, visits an unmarked node that is adjacent to at least one visited node.

In general, the number of colors needed does not exceed the maximum degree of each node

+1. These properties are the subject of Exercises 9 and 8.

¥ T © © §¦

¥

Figure 3.10 illustrates the algorithm for the same example used earlier,

i.e., the ¬nite element mesh problem of Figure 2.10. The dashed lines separate the different

color sets found. Four colors are found in this example.

… ‘ 1) … 0 1 X…

Once the colors have been found, the matrix can be permuted to have a block structure

3¦

in which the diagonal blocks are diagonal. Alternatively, the color sets ,,

and the permutation array in the algorithms can be used.

d nd¡ £ ¨¡ d¥ $ ¥ £ ”¤§¤

u © n ¥ u§¥ ©

¤ §¥ ¡ ©

¨

¤©

¡ ¥

6

15 12

4 9 5

11 14 8

2 10 3

13 7

1

„

¡ T © ¥ ¢ D

¡

Graph and matrix corresponding to mesh of

Figure 2.10 after multicolor ordering.

¤ ¡¥¤ ¤£ ¨ ¥B

¥

¡ 1 © § §

)1)1A6 0 '

Remember that a path in a graph is a sequence of vertices , which are such

4 B y i)1)‘ }

3

0

that is an edge for . Also, a graph is said to be connected if

C ¨

there is a path between any pair of two vertices in . A connected component in a graph

is a maximal subset of vertices which all can be connected to one another by paths in the

graph. Now consider matrices whose graphs may be directed. A matrix is reducible if its

graph is not connected, and irreducible otherwise. When a matrix is reducible, then it can

be permuted by means of symmetric permutations into a block upper triangular matrix of

the form

1111

344 @8

99

60

00 0

¡

66 6

.

.. .

5 A

. .

#F#

where each partition corresponds to a connected component. It is clear that linear systems

with the above matrix can be solved through a sequence of subsystems with the matrices

)i1)1‘ # q

3

, .

¡ ¡

ud

¤§ ¥ §¢

¡

¡© © ¢ ¡ ¥ ¥ © ¡ ¥

§

) &% $© ¨ ) ©'§ ( )