A self-stabilizing algorithm for locating the center of Cartesian product of K 2 and maximal outerplanar graphs

—Self-stabilizing algorithms model distributed systems and allow automatic recovery of the system from transient failures. The center of a graph is the set of vertices with the minimum eccentricity. In this paper we investigate the self-stabilizing algo-rithm for ﬁnding the center of Cartesian product of K 2 and maximal outerplanar graphs.


I. INTRODUCTION
L ET G = (V (G), E(G)) be a simple, con- nected graph with the vertex set V and edge set E. The distance d(i, j) between nodes i and j is the length of the shortest path connecting these two nodes.The maximum distance from a given vertex i to any other vertex in the graph G is called the eccentricity ecc(i) of the vertex i.The set C(G) of the vertices with the minimum eccentricity is called the center of the graph G (see Fig. 1).
The Cartesian product G 1 G 2 of simple graphs G 1 and G 2 is a graph with the vertex set and the edge set In many cases it is important to locate the center of a graph, especially in distributed systems, where it allows placing a control center for the minimum cost of communication with peripherial nodes of the system.There are several known algorithms for locating centers in graphs.Bielak and Pańczyk [1] proposed algorithm finding weighted centroid in a tree.Farley [6] gave a linear time algorithm for vertex centers in trees.Also Hedetniemi et al. [11] gave linear time algorithm for center problems in trees.Goldman [9] and Kariv and Hakimi [12] gave an algorithm solving the center problem in networks.
A lot of research has been realized related to centers of graphs [14], [15], [3].Distributed algorithms were also developed [2], [13].In this paper we propose a self-stabilizing algorithm for locating the center of Cartesian product of complete graph K 2 and maximal outerplanar graph.The problem for maximal outerplanar graphs, in classical, sequential computing paradigm was solved by Farley and Proskurowski [7].Let us define a maximal outerplanar graph as it was done in the mentioned paper [7], as a triangularization of a planar polygon (see Fig. 1).We define K 2 as a complete graph with two vertices.
In a maximal outerplanar graph M = (V (M ), E(M )) every edge p = {i, j} ∈ E(M ) partitions the set of all vertices apart i and j into two distinct sets inducing connected subgraphs called sides.One of the sides may be empty.It is the case when the partitioning edge is a part of the exterior face of the graph.In fact, all the edges with one side empty form the unique Hamiltonian cycle.
Let us note that in a maximal outerplanar graph every two neighbors i and j have at most two common neighbors, each of them belonging to distinct sides of the edge {i, j}.Thus, it is sufficient to represent the side of the edge by one of the two common vertices adjacent to the edge.If a side is empty, we set ∅ as its representation.
In the Cartesian product of K 2 and any graph G, we can identify two layers of which every one is isomorphic to the graph G.
Farley and Proskurowski [7] introduced a notion of the edge eccentricity.Let us have the node i, its neighbor j and one of their common neighbors k (∅ for the one nonexistent if applicable) in a graph G.For these three values we define e(i, j, k) (edge eccentricity) in the following manner: • the absolute value of e(i, j, k) is equal to the eccentricity of the vertex i in the subgraph of G induced by S k ∪ {i, j}, where S k is the side of the edge {i, j} containing the vertex k, • e(i, j, k) is negative integer iff all vertices of S k ∪ {i, j} at distance d = |e(i, j, k)| from i lie at distance d − 1 from the vertex j.The classical algorithm of Farley and Proskurowski [7] computes the edge eccentricity for every edge recursively using already computed values of the eccentricities for adjacent edges.It starts with outerface edges, for which the edge i j Fig. 2.An example of K 2 maximal outerplanar graph.
eccentricity (on an empty side) is equal to -1.All the details can be found in [7].
In this paper we propose a self-stabilizing algorithm for finding the center in the Cartesian product of K 2 and a maximal outerplanar graph.In the following section we introduce the computational model used futher in the paper.In section III we show the notation useful in the algorithm.The algorithm is presented in section IV and its correctness and complexity is discussed in section V.

II. COMPUTATIONAL MODEL
A notion of self-stabilizing algorithms on distributed systems was introduced by Dijkstra [4].A survey in the topic can be found in the paper by Schneider [16], and further details in the book by Dolev [5].The notions from graph theory not defined in this paper one can find in the book by Harary [10].
A distributed self-stabilizing system consists of a set of processes called computing nodes and communication links between them, which we can be modelled topologically by a graph.We assume that every node in the system runs the same algorithm and can change the state of the local variables.These variables determine the local state of a node.Moreover, nodes can observe the state of variables on themselves and their neighbor nodes.The state of all the nodes in the system determines the global state.In this paper we assume that every node has unique identificator (id).
Every self-stabilizing algorithm should have a class of global states defined, that are called the legitimate states, for which the system is stable, which means that no action should and can be done by the algorithm itself.Every other global state is called the illegitimate and for the algorithm to be correct there has to be some possibility 94 POSITION PAPERS OF THE FEDCSIS.WARSAW, 2014 to make a move in this kind of state.Every possible sequence of moves made by the algorithm must end up with the legitimate state.Indeed, it is the aim of every self-stabilizing algorithm to bring the system to the legitimate (desirable) state, either after some alteration (from the outside of the system) of variables in the nodes had been done or after the system had been started.Generally, an algorithm consists of a set of rules.A rule has the form: label: If guard then assignment instructions where definitions of objects.
A guard is a logic predicate which can refer to variables in the node itself and its neighbors.
A label and a where clause are optional.We say that a rule is active if its guard is evaluated to true.A node is active if it contains any active rule.If there is no active node in the graph, we say that the system is stabilized.Let us note that in a stabilized system no move can be made.One of the required property of a self-stabilizing algorithm is to make a system stabilized if and only if its state is legitimate.We assume that active rules are triggered in an arbitrary order.

III. NOTATION
The main difficulty in enhancing the algorithm for locating the center in a maximal outerplanar graph to the Cartesian product of a maximal outerplanar graph and K 2 is to distinguish nodes that are placed in the same layer or not.Once it is done, the basic algorithm for a maximal outerplanar graphs can be easily adapted.
Theorem 1.For every Cartesian product G = K 2 M , where M is a maximal outerplanar graph, the graph induced by C(G) is the same as the Cartesian product of K 2 and the graph induced by C(M ).
Thus, the center of G is the same as the sum of the centers of both layers of graph G.
There are two types of neighbors (of any node i ∈ V (G)) in the graph (see Fig. 2).The first one consist of nodes in the same layer, which together form triangle faces of a maximal outerplanar graph.The second, say j, is a neighbor which belongs to the other layer, we call such two nodes i, j the pairing nodes.
We define the following predicate to determine whether any two neighbors are pairing nodes: We will use this predicate in the definition of N l (i), which we define as a set of neighbors from the same layer (maximal outerplanar graph): In the algorithm we will use the following notation: n(i) -a variable storing the set of neighbor nodes (from the same layer) for the node i.
Note that n(i) is a variable, whose value may be incorrect at the beginning of the algorithm run, whereas N l (i) is a set which is determinable by the node i only, based on the topology of the network by looking at connections of node i; it can be computed only by the node i.Thus the n(i) variable is set to allow a neighbor to determine other neighbors of the node i. c(i, j) -a variable (stored in the node i) which stores the set of common neighbors for nodes i and j, e(i, j, k) -a variable storing (in the node i) the edge eccentricity for the edge {i, j} and the side containing the common neighbor k (of the nodes i and j; k = ∅ for an empty side), opp(i, j, k) -a variable storing (in the node i) the representation of the side opposite to k (against the edge {i, j}), v(i) -a variable storing (in the node i) the eccentricity of the vertex i, note that it is not the edge eccentricity, i.e. in a legitimate state v(i) = max k |e(i, j, k)| for any j ∈ N (i), and v(i) ≥ 1 for any node i. m(i, j, k) -a pair stored in the node i for inside the dual vertex {i, j, k}.After stabilization, its first element is the eccentricity of the center nodes.The second element of the pair is the direction, that the information about the eccentricity of the center comes from.
If for the dual vertex {i, j, k} the information comes from the region incident to the edge {i, j}, then the direction is equal to opp(i, j, k).In the case the information about the center eccentricity comes originally from the dual vertex {i, j, k}, then we set the direction to ∅.
IV. THE ALGORITHM In this section we present the rules of our algorithm (see Fig. 4).The first rule assigns the set of all neighbors of the node i in the same layer to its variable n(i).Thanks to this, a node can know neighbors (in the same layer) of its neigbor, which is exploited in further rules.The second rule assigns in a node i the set of common neighbors in the same layer with node k: c(i, k).
The rule 3a assigns outside edge eccentricity and sides of an edge.Rules 3b and 4 compute edge eccentricities according to [7] and both of them set v(i) to proper value (see Fig 3).
The rule 5 propagates the minimum eccentricity through all the graph.The idea of the inside dual tree is used [8].The information about the minimum eccentricity is propagated through the dual tree.
Note that in the rule 5 we used the function M inEcc(i, j, k), returning the value of m(i, j, k).The M inEcc function is defined as follows (see Fig. The M inEcc function computes the minimum value over eccentricities and the direction that it Function M inEcc(i,j,k) The visualization of computation of the function M inEcc(i, j, k).The numbers stand for the order of checking (and assigning if necessary) values of m(•, •, •).The order above is: 1. (v(i), ∅) (lines 1-2 of the M inEcc function), 2. m(k, i, j) (lines 3-5), 3. m(j, i, k) (lines 6-8), 4. m(i, j, opp(i, j, k)) (lines 9-12), 5. m(i, k, opp(i, k, j)) (lines [13][14][15][16].The question mark stands for m(i, j, k), which is the computed value.comes from for the triangle region specified by three parameters i, j, k (see Fig. 5).The first step is to consider the node i itself as a candidate with the minimum value of the eccentricity available in the neighborhood.In this case the direction would 96 POSITION PAPERS OF THE FEDCSIS.WARSAW, 2014 then e(i, j, ∅) where ) if e(j, k, opp(j, k, i)) > 0, e(j, k, opp(j, k, i)) otherwise then m(i, j, k) := M inEcc(i, j, k) be ∅ as it does not come from other region.In the second and third step, the node i checks the neighbor nodes k and j as a candidates for the minimum value.If the values in the nodes k or j come from regions incident to the edges {i, k} or {i, j}, they are not trusted.It is to ensure that no wrong value can last in the region infinitely long time (number of moves).And last two steps, the values from two neighbor regions (incident to i) are checked.
V. CORRECTNESS AND COMPLEXITY Now we prove some properties of the algorithm.We assume that n is the number of nodes in a layer (a maximal outerplanar graph) of the graph.Lemma 1. Algorithm consisting of rules 1-4 stabilizes in O(n 2 ) number of moves.
Proof: The stabilization of the rule 1 is obvious as the guard does not depend on variables in neighbor nodes.So the rule 1 gets inactive in finite time.The rule 2, depends only on static (after stabilizing of the rule 1) information computed by the rule 1. Hence it stabilizes in limited by a constant number of moves per node, as rule 1 does.
The same applies to rule 3a, as it depends on variable values computed by two former rules, because it is for an outerface edge (i.e. the edge belonging to Hamilton cycle), which is an initial case of the recursive classical algorithm.Once the c(i, j) is properly computed in the node i, it never changes.Thus if any of the variables e(i, j, ∅), opp(i, j, ∅) or opp(i, j, k) is in a wrong state, then all are correctly computed and also never change.
Now all the nodes have got rules 3a and 3b inactive.Then we consider the rule 4. Note that this rule is applicable only for graphs bigger than a triangle.Suppose there are two adjacent edges lying on an outerface of the graph.There has to be the third edge, which is also adjacent to them, and the edge eccentricities of this edge stabilize with rule 4.This is the first layer of proper rule 4 computation.Each next layer of proper computation of rule 4 depends on a previous layer.We have a finite graph, so the rule 4 stabilizes.As each layer of computation of rule 4 takes O(n) moves and there are O(n) layers, it all takes O(n 2 ) moves.The last layer of computation stabilizes by rule 3b, as it reaches the another outerface of the graph.
The following lemma describes the situation after stabilization of rules 1-4.Lemma 2. If the phase 1-4 has stabilized a system, then phase 5 will stabilize in O(n 2 ) number of moves.
Proof: The pessimistic case would be if every dual vertex had wrong value for variable v(i)for example as a result of start up of the systemand having also wrong values of m(•, •, •) for every dual vertex (representing a region of the layer, i.e. maximal outerplanar graph).Let us assume that every v(i) is less than the proper minimum eccentricity and there are no nodes i, j such that v(i) = v(j).Then the pessimistic order of propagation of the m(•, •, •) values would be when the value v(i) spreads the first (for some i) which is the biggest among all the other v(k) (for all nodes k except i) but still it is less then the proper minimum eccentricity.
The above propagation takes O(n) moves.Note that now the dual tree is filled with improper value of some v(i).But there are n − 1 wrong candidates of the minimum eccentricity to spread left.Once again, the pessimistic case would be when the next value to propagate was the maximum among all the candidates, which is less then the spread in the tree.
Each of these phases takes O(n) moves and there are O(n) phases, so all pases of rule 5 run in O(n 2 ) moves.Now we can formulate the following theorem.
Theorem 2. The algorithm takes O(n 4 ) number of moves to stabilize.
Proof: The computation in each of layers is independent, so by Lemmas 1 and 2 we get the result.

VI. CONCLUSIONS
In this paper we proposed a self-stabilizing algorithm for finding the center of the Cartesian product of graph K 2 and a maximal outerplanar graph.We hope the method similar to the presented here can be applied to other classes of graphs.The open question is if there exists an algorithm with better complexity -number of moves bringing a system to the legitimate state.
5): Two projection functions are used in the above function: f st((a, b)) def = a and snd((a, b)) def = b, which take the first and second element of the pair, respectively.

Fig. 4 .
Fig. 4. The self-stabilizing algorithm for finding the center in K 2 maximal outerplanar graph.