

![0_image_0.png](0_image_0.png)

$$\left(15\right)$$

Figure 4: Example of the working of phase II of FrogSim. Nodes **are labeled with their**
respective color. The nodes' powers are shown as sub-indices of their colors. Graphic (a) shows a fictitious situation after phase I. Three colors are used in the current feasible coloring. The fictitious θ**-values are as indicated besides the nodes. Note that in phase II they will not**
change anymore. Initially the nodes with color 1 receive a random power greater than 0 (in this case, 2, respectively 5), while the remaining nodes receive a power of 0. First, the node with highest power forces its neighbor to adopt its power (a color change of the neighbor is not necessary). Then, this neighbor, which has color 2, forces its other neighbor to adopt color 1 and power 5 (see graphic (b)). This creates a conflict. **However, due to the fact that**
power 5 is greater than power 2, the last node is forced to change its color from 1 to 2. Note that the final situation uses one color less than the original **one.**
m ∈ Mi such that colorm = ci and powerm ≥ pi. In words, node i **only changes its color if**
there is an adjacent node with the same color and a higher (or equal) power value. The new color chosen by node i **is the first free color that is not already in use by a node influencing** node i and that has a power equal to or greater than the power value of node i**. Formally,**
the new color ciis chosen in function **minimumColorNotUsedByNeighborsWithHigherPower()** as follows:

$$c_{i}:=\operatorname*{min}\{c\in\mathbb{N}\mid\mathbb{Z}m\in M_{i}{\mathrm{~with~color}}_{m}=c\land{\mathrm{power}}_{m}\geq p_{i}\}$$

In addition, node i updates its power value in function **adoptPowerFromStrongestNode()** in the following way:
pi:= **argmax**m∈Mi

{powerm} **(16)**
This is the highest power among the powers of the nodes that have forced node i **to choose** its current color. As a result, in following communication rounds node i **will not be forced** to change its color, because with the new power it has priority over all nodes with a lower power. Finally, node i sends a refinement message m in function **sendRefinementMessage()**, where m **is defined as follows:**

$$2\pi=1,\quad\pi=1,\quad\pi=-1,\quad\pi=-1$$
$\downarrow$ U. 
$$m=<\operatorname{color}_{m}:=c_{i},\mathrm{power}:=p_{i}>$$
m =< colorm := ci, power := pi > **(17)**
The last action of the sensor event consists again in deleting all messages from the message queue Mi, that is, Mi = ∅**. Figure 4 shows a small example of the kind of conflicts that**
phase II is supposed to resolve.

$\left(17\right)^{2}$