0% found this document useful (0 votes)
607 views43 pages

Channel Access Protocols For Ad Hoc Networks: Instructor: Carlos Pomalaza-Ráez Fall 2003 University of Oulu, Finland

The document discusses media access control (MAC) protocols for ad hoc networks. It covers key issues for wireless MAC like half-duplex operation, time varying channels, and location-dependent carrier sensing. It also describes different types of MAC protocols and performance metrics. Specific distributed MAC protocols covered include the Distributed Foundation protocol used in IEEE 802.11 which uses a four-way handshake of RTS, CTS, DATA and ACK to avoid collisions. An example is provided to illustrate how it works.
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
607 views43 pages

Channel Access Protocols For Ad Hoc Networks: Instructor: Carlos Pomalaza-Ráez Fall 2003 University of Oulu, Finland

The document discusses media access control (MAC) protocols for ad hoc networks. It covers key issues for wireless MAC like half-duplex operation, time varying channels, and location-dependent carrier sensing. It also describes different types of MAC protocols and performance metrics. Specific distributed MAC protocols covered include the Distributed Foundation protocol used in IEEE 802.11 which uses a four-way handshake of RTS, CTS, DATA and ACK to avoid collisions. An example is provided to illustrate how it works.
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 43

Channel Access Protocols

for
Ad Hoc Networks

Instructor: Carlos Pomalaza-Ráez

Fall 2003
University of Oulu, Finland
Media Access Control (MAC)
• Protocols that enable multiple users to share a
finite amount of frequency and time resources
• Needed for efficient operation and good
performance for wireless systems
• An important goal is to minimize overhead while
maximizing overall network capacity
• Ad Hoc networks have no pre-existing
infrastructure or centralized administration, e.g.
base stations, and as such they require distributed
MAC protocols
Wireless MAC issues
 Half-duplex operation
 Time varying channel
• reflection received signal
multipath
• diffraction power varies as
fading
• scattering function of time

 Burst channel errors


• bit-error rate can be as high as 10-3 or higher
• packet loss can be minimized by using smaller packets,
forward error correcting codes and retransmission
methods such as acknowledgement packets
Wireless MAC issues
 Location dependent carrier sensing
• Hidden nodes. A hidden node is one that is within the
range of the intended destination but out of range of
the sender
• Exposed nodes. An exposed node is one that is within
the range of the sender but out of range of the
destination
• Capture. This event occurs when a receiver can
correctly receive a transmission from one of two (or
more) simultaneous transmissions, all within its range,
because the signal strength of the correctly received
signal is much higher than strength of the other signals
Hidden and Exposed Node Problems

A B C
Hidden node
• A is transmitting to B
• C is out of range of A and is unaware of the transmission
• If C transmits to B it will cause a collision at B

A B C D
Exposed node
• B is transmitting to A
• C wants to transmit to D
• C senses transmission & declines even if its transmission
will not cause any collision at A
Capture Problem
If A and C transmit
simultaneously to B then
the signal power of C,
received at B, is higher than
dAB
A B dCB the one from A (because
dCB < dAB) and there is a
C
good probability that C’s
signal can be correctly
decoded in the presence of
D A’s transmission

This capture of C’s signal can improve protocol performance, but it results
in unfair sharing of the channel with preference given to nodes closer to the
receiver. Wireless MAC protocols need to ensure fairness under such
conditions
Classification of MAC Protocols
Wireless MAC protocols can be classified into two categories,
distributed and centralized, according of the type of network architecture
for which they have been designed. Protocols can be further classified,
based on the mode of operation, into random access protocols,
guaranteed access protocols, and hybrid access protocols

Wireless MAC protocols

Distributed Centralized
MAC protocols MAC protocols

Random Random Guaranteed Hybrid


access access access access

Since we are interested in Ad Hoc networks we will focus


our discussions on distributed type protocols
Performance Metrics
 Delay – Average time spent by a packet in the MAC queue. It is a
function of protocol and traffic characteristics
 Throughput – Fraction of the channel capacity used for data
transmission
 Fairness – A fair MAC protocol does not exhibit preference to any
single node when multiple nodes are trying to access the channel
 Stability – A stable system can handle instantaneous loads that are
greater than the maximum sustained load
 Robustness against Channel Fading
 Power Consumption – Most wireless devices have limited battery
power, it is then important to design MAC protocols that have power
saving features
 Support for multimedia – Protocols need to treat packets from various
applications based on their delay constraints. Common methods are
the use of access priorities and scheduling
Distributed MAC Protocols
These protocols are based on carrier sensing and collision avoidance
Carrier sensing refers to listening to the physical medium to detect any
ongoing transmission
Collision avoidance techniques must be implemented to minimize
the probability of collisions. Two mechanisms can be used:
 Collision Avoidance with Out-of-Band Signaling such as the one used
in the BTMA (busy tone multiple access) protocol → F.A. Tobagi and
L. Klienrock, “Packet Switching in Radio Channels: Part II – The
Hidden Terminal Problem in Carrier Sense Multiple Access and the
Busy Tone Solution,” IEEE Trans. Commun., COM-23, 1975, pp.
1417-1433
 Collision Avoidance with Control Handshaking such as one used in
MACA (multiple access with collision avoidance) protocols → P.
Karn, “MACA – A New Channel Access Method for Packet Radio.”
ARRL/CRRL Amateur Radio 9th Computer Networking Conf., 1990
Distributed Foundation Wireless MAC
 It is a derivative of the MACA protocol
 It is the basic access protocol of the IEEE 802.11 standard
 Consists of a four-way exchange, RTS-CTS-DATA-ACK
DIFS SIFS
Sender
node
RTS DATA
SIFS SIFS
Receiver
node CTS ACK

NAV(DATA)
NAV(CTS)
Others NAV(RTS)
NAV- Network Allocation Vector

1
Distributed Foundation Wireless MAC
To give preference to a stations trying to send and ACK
different waiting intervals are specified:
 DIFS (distributed inter frame space) → a node must
sense channel idle for DIFS interval before making an
RTS attempt
 SIFS (short inter frame space) → a node has to sense
channel idle for SIFS before sending an ACK.
SIFS < DIFS
 NAV (Network Allocation Vector): Packets contain
time field (NAV) to indicate duration of current
transmission.
 All nodes that hear RTS/CTS back off NAV amount
(time) before sensing the channel.
1
Performance Analysis of 802.11 DCF
 Assumptions
 Fixed number of stations, each always having a packet available for
transmission (saturation condition)
 Each packet needs to wait for random backoff time before transmitting
 Constant & independent collision probability for each transmitted packet
 Ideal channel condition (no hidden terminals and capture)
 Notation
 b(t) = stochastic process representing the backoff time counter
 CWmin = minimum contention window = W
 m = maximum backoff stage → CWmax = 2mW
 Wi = 2iW, where i  (0,m) is called “backoff stage”
 s(t) = stochastic process representing the backoff stage at time t
 p = probability of each transmitted packet being collided

1
802.11 DCF Example
{s(t0),b(t0)} = {0,3} {s(t9),b(t9)} = {1,7}
SIFS SIFS DIFS
DIFS BO=5
Station A BO=3 BO=4 BO=7
RTS DATA RTS Busy channel

t0 t1 t2 t3 t4 …... t8 t9
Station B CTS ACK

collision
DIFS BO=4 DIFS
Others BO=7 Busy channel NAV(RTS) BO=4 RTS BO=2 RTS
ACK Busy channel NAV(CTS)

Station A has a packet to transmit to station B. At the end of the ACK station A waits for a
DIFS and then chooses a backoff time equal to 3 before sending an RTS to station B. Another
station also waits for a DIFS and chooses a backoff time equal to 7. At t 3 station A initiates the
RTS/CTS transaction with station B. The station that had a backoff time of 7 “freezes” its timer
until the channel is idle again. After B’s ACK station A has another packet to transmit and this
time it chooses a backoff time of 4 which brings it to a collision condition with the station that
had resumed its counter. Because of the collision station A increments its contention window
size and chooses a backoff time of 7.
1
802.11 DCF - Markov Chain Model
A bi-dimensional process model {s(t),b(t)} can be used (*) which leads
to a discrete-time Markov chain model with the following transition
probabilities:

P{i,k | i, k+1} = 1; k  (0, Wi – 2), i  (0,m)

1
i,k+1 i,k

This equations accounts for the fact that, at the beginning of each slot
time, the backoff time is decremented as long as the counter has not
reached zero and that the channel has been sensed idle for a mini-slot

(*) G. Bianchi, “Performance Analysis of the IEEE 802.11 Distributed


Coordinated Function,” IEEE Journal on Selected Areas in Communications,
vol. 18, no. 3, March 2003, pp. 535-547
1
802.11 DCF - Markov Chain Model
P{0,k | i, 0} = (1-p)/ W0 ; k  (0, W0 – 1), i  (0,m)

Tx
Success
i,0
(1-p)/ W0

0,0 0,1 ... 0,W0 – 2 0, W0 – 1

This equations accounts for the fact that a new packet following a
successful packet transmission starts with backoff stage 0, and that the
backoff is initially uniformly chosen in the range (0, W0 – 1)
1
802.11 DCF - Markov Chain Model
P{i,k | i-1, 0} = p/ W1 ; k  (0, Wi – 1), i  (1,m)

Tx
Collision
i-1,0
p/ Wi

i,0 i,1 ... i,Wi – 2 i, Wi – 1

When an unsuccessful transmission occurs at backoff stage i-1, the


backoff stage increases, and the new initial backoff value is uniformly
chosen in the range (0, Wi)
1
802.11 DCF - Markov Chain Model
P{m,k | m, 0} = p/ Wm ; k  (0, Wm – 1)

0,0 0,1 ... 0,W0 – 2 0, W0 – 1

(1-p)/ W0

m,0
p/ Wm

m,1 m,2 ... m,Wm – 2 m, Wm – 1

This equation models the fact that once the backoff stage reaches the
value m, it is not increased in subsequent packet transmissions
1
Steady State Probabilities
The stationary transition probability distribution π(i,k) is then
 (i,0)  p i (0,0) 0  i  m
pm
 (m,0)   (0,0)
1 p
Wi  k
 (i, k )   (i,0) i  (0, m), k  (0, Wi  1)
Wi
π(0,0) is determined by using the normalization condition
m Wi 1

   (i, k )  1
i 0 k 0

from which
2(1  2 p )(1  p )
 (0,0) 
(1  2 p )(W  1)  pW (1  (2 p) m )
1
Steady State Probabilities
The probability that a station transmits in a randomly chosen slot time can be
derived since any transmission occurs when the backoff time counter is zero

m
2(1  2 p )
    (i,0) 
i 0 (1  2 p )(W  1)  pW (1  (2 p) m )

p, the probability that a transmitted packet encounters a collision, is the


probability that in a time slot at least one of the n-1 remaining stations
transmits. At steady state, each remaining station transmits a packet with
probability τ, this results in

p  1  (1   ) n 1

From this two equations the values for p and τ can be found using
numerical techniques
1
Throughput
Let Ptr be the probability that there is at least one transmission in the
considered slot time, i.e.,
Ptr  1  (1   ) n

The probability Ps that a transmission on the channel is successful is


given by the probability that exactly one station transmits on the
channel, conditioned on the fact that at least one station transmits, i.e.,
n (1   ) n 1 n (1   ) n 1
Ps  
Ptr 1  (1   ) n
The normalized throughput S, defined as the fraction of the time the
channel is used to successfully transmit payload bits is then

E[payload information transmitted in a slot time]


S
E[length of a slot time]
2
Throughput
If E[P] is the average packet payload then S can be expressed as

Ps Ptr E[ P ]
S
(1  Ptr )  Ptr PsTs  Ptr (1  Ps )Tc

where
  duration of an empty slot time
Ts  average time the channel is sensed busy because of a successful transmission
Tc  average time the channel is sensed busy by each station during a collision

For the basic access mechanism (no RTS/CTS transaction) the packet header is

H  PHYhdr  MAChdr

And let δ be the propagation delay

2
Throughput – Basic Access
SIFS DIFS
PHYhdr MAChdr PAYLOAD ACK

Tsuccess (basic access)

PHYhdr MAChdr DIFS


PAYLOAD
Tcollision (basic access)

Tsbasic  H  E[P]  SIFS    ACK  DIFS  


Tcbasic  H  E[ P * ]  DIFS  
E[P*] is the average length of the longest packet payload involved in a collision

n k Where F(.) is the


k  2  k 
Pmax

n
  (1   ) nk
(1  F k
( x))dx probability distribution
E[ P * ]    0
function for the packet
1  (1   ) n  n (1   ) n 1 payload size
2
Throughput – RTS/CTS

RTS SIFS CTS SIFS PHYhdr MAChdr PAYLOAD SIFS ACK DIFS

Tsuccess (RTS/CTS)

RTS DIFS

Tcollision (RTS/CTS)

Tsrts / cts  RTS  SIFS    CTS  SIFS   


H  E[ P ]  SIFS    ACK  DIFS  

Tcrts / cts  RTS  DIFS  

2
Model Validation
The model is validated by comparing its results with those obtained
via simulation. The parameters used for the validation study are
summarized in the following table. A PHY layer using a FHSS
modulation system is assumed.

Packet payload 8184 bits Channel Bit Rate 1Mbit/s


MAC header 272 bits Propagation Delay 1μs
PHY header 128 bits Slot Time 50 μs
ACK 112 bits + PHY header SIFS 28 μs
RTS 160 bits + PHY header DIFS 128 μs
CTS 112 bits + PHY header ACK-Timeout 300 μs
CTS-Timeout 300 μs

2
Model Validation- Simulation vs. Analysis

Analytic results are represented by lines, simulation results by symbols


2
Elimination Yield – Non-Preemptive
Multiple Access (EY-NPMA)
EY-NPMA is the channel access protocol used in the HYPERLAN
system. HIPERLAN is a high-speed (24 Mb/s) wireless LAN standard.
The protocol works as follow:

 A node that has data to transmit senses the channel


 If the channel is free for at least 1,700 bits then it is considered free
and the node can start transmitting
 Each data frame must be explicitly acknowledge with an ACK packet
 If the channel is sensed busy the node synchronizes itself with the end
of the current transmission interval
 At that point a channel access cycle begins according to the EY-
NPMA scheme
 This scheme has 3 phases: prioritization, contention, and transmission

2
Channel Access (EY-NPMA)
Prioritization Contention phase Transmission phase
phase

Elimination phase (B) Yield phase (D)

Data Frame
ACK
Priority
Detection
Cycle Priority Survival
Synchronization Assertion Verification
Interval Interval

 In the prioritization phase only the nodes with the highest channel access priority frame
are allowed to continue to the next phase
 The contention phase has 2 sub-phases: elimination, and yield
 In the elimination phase each node transmits for a random number of slots after which it
listen to the channel. If the channel is busy the node loses contention and waits for the
next cycle. If the channel is idle the node moves to the yield phase
 In the yield phase the node listens to the channel for a random number of slots. If no
transmission is detected during this time, the node starts and completes its data
transmission
2
Channel Access (EY-NPMA)
For the prioritization phase each frame is assigned a priority level h  (0, H-1).
Each node that has a frame with priority h senses the channel for the first h
prioritization slots. If the channel is idle during this interval, then the node transmits
a burst in the h + 1 slot and it is admitted to the contention phase, otherwise it stops
contending and waits for the next channel access cycle.

The elimination phase consists of at most n slots followed by an elimination survival


verification slot. Starting from the first elimination slot, each node transmits a burst
for a number B, 0≤ B ≤ n, of subsequent elimination slots.
B has a truncated geometric probability (1  q)q b 0  b  n
Pr{B  b}   n
distribution function, i.e., q bn

The yield phase consists of at most m yield slots. Each node listens to the channel
for a number D, 0≤ D ≤ m, of yield slots before beginning a transmission.
D has also a truncated geometric probability (1  p) p d 0  d  m
distribution function, i.e., Pr{D  d }   m
 p bm

2
Performance Analysis (EY-NPMA)
Analysis of the HIPERLAN MAC protocol via a mathematical model is very
difficult because of the complexity and level of interdependence of the various
processes that are involved. Therefore the analysis is carried out using simulation
models. For the study carried by Anastasi et. al. (*) the simulation model compared
the performance of the protocol with different arrival processes. The nodes have
infinite buffers and they contribute with the same offered load.
Poisson and ON/OFF processes are used. The ON/OFF period lengths are Weibull
distributed with α = 1 (Markov Modulated Markov Process) and α < 1.
Studies have shown that experimental data related to WWW applications
can be satisfactorily modeled by ON/OFF processes where the ON and
OFF time-lengths distributions are heavy tailed, e.g. Weibull, Pareto. The
Weibull probability distribution function of a random variable X is:
 ( x /  )
P{ X  x}  1  e ,x 0

(*) G. Anastasi, L. Lenzini, and E. Mingozzi, “Stability and Performance Analysis of


HIPERLAN,” Proceedings of IEEE INFOCOM’98, pp. 134-141.
2
Simulation Analysis (EY-NPMA)

3
Multi-Channel Assignment Approach

6 7

2
1
5

3 4 8

 Proposed for CDMA Ad-Hoc Networks


 Nodes use different channels (codes) to transmit data
 The codes must be “locally” unique but they can be reused
 The code or channel can be used as an implicit address for the node
 Similar approach is used in cellular networks but there the topology is
static
3
Channel Assignment in Ad Hoc Networks

Let G(V,E) be the graph


representation of the
network and Δ the
maximum degree of the
graph. The problem of
channel assignment
becomes then one of
graph coloring

For any node:


 All its neighbors have different colors (ROCA), or
 All two-hop neighbors have different colors (TOCA)
ROCA = Receiver-Oriented-Code-Assignment
TOCA = Transmitter-Oriented-Code-Assignment
Brooks and Vizing theorem: Number of colors needed  min{(  1)  1, V }
3
Channel Assignment in Ad Hoc Networks
In Ad-Hoc networks:
 There is no base station
 Nodes are free to connect or disconnect
 Nodes move about
 Increase or decrease their transmission range
 Should minimize or avoid the primary and secondary conflicts

Two transmissions with the same A transmission arrives at a node that is


code arrive at a node simultaneously receiving a signal with a different code

These features call for distributed, dynamic, code assignment algorithms


3
Minimal Recoding Strategies
 A change in the code assignment (recoding) is needed to eliminate
potential collisions caused by nodes joining the network, moving, or
changing the power of their transmissions
 The recoding strategy must be distributed and local
 The number of events required for recoding should be minimized
 The maximum number of codes needed for a proper recoding should
be also minimized
 Used TOCA method since it has better performance1
 Assign a code ci to each node such that,
 CA1 - For every edge (vi,vj)  E, ci ≠ cj (primary collision avoidance)
 CA2 - For every pair of edges (vi,vk), (vj,vk)  E & i ≠ j, ci ≠ cj (secondary
collision avoidance)
 Graph coloring problems of this nature are NP-complete
(1) L. Hu, “Distributed Code Assignment for CDMA Packet Radio Networks,” IEEE Trans.
on Networking, vol. 1, no. 6, December 1993, pp. 668-677
3
Recoding on Node Join
Consider the event where a new node n joins an Ad Hoc network

Set 1n … Set 2n

… …
……

……
n
Set 4n Set 3n

Node n joins
Nodes in 3n need not change their color since n will be assigned a new color
different from any color in 3n. To minimize the amount of recoding there is only
to recode the nodes in the set 1n U 2n U {n}
3
Recoding on Node Join
If the set of old colors in 1n U 2n is {C1, C2,…, Cm} and the number of nodes in 1n U 2n
with these corresponding colors is {K1, K2,…, Km}, then apart from recoding n, at least
m m

 (K
i 1
i  1)   K i  m of the nodes in 1n 2 n
i 1

need to be recoded with different new colors to avoid conflicts into the new code
assignment after node n joins the network. To find out which nodes to chose for
recoding one can use the following approach(1).
Consider the undirected graph G’= (V1 U V2, E’) where,
V1 = 1n U 2n U {n}
V2 = {i : i  Z+ & i ≤ max = maximum color constraint in the vicinity of 1n U 2n U {n} }
E = {(u,v) : u V1, v V2, u is not constrained to be newly colored with v}
“maximum color constraint in the vicinity of 1n U 2n U {n}” means the maximum
integer among all constraints due to 3n U 4n on nodes 1n U 2n U {n}, e.g. the set of old
colors in 3n U 4n forbidden to be assigned to nodes in 1n U 2n U {n} due to the
constraints CA1 and CA2, and all old colors in 1n U 2n . The edges in E are weighted;
edges (u,v), u 1n U 2n , v V2 where v is the old color assigned to node u are given a
weight of 3; all other edges have weight 1.
(1) I. Gupta, “Minimal CDMA Recoding Strategies in Power Controlled Ad-Hoc Wireless Networks,” Technical Report,
Dept. of Computer Science, Cornell University, 2001. 3
Recoding on Node Join (Example)
1n U 2n
2
H B
A 3

D
F 1
3 C
1

4n G
2

E 3

1n = {G}, 2n = {A,B,F,C}, 3n = { }, 4n = {D,F}. The original color assignment,


before node H joins the network, is indicated next to each node (in the square box).
Next G’ is built as previously defined. Note that G’ is a bipartite graph.
3
Recoding on Node Join (Example)
A 1 Consider now the maximum matching M
3 M E
1 on this bipartite graph. M is a set of edges
B 1
1
with no common end-vertices and with
3
the maximum total weight among all such
3
sets. There are many efficient algorithms
C
1 to find a maximum matching of a
2
3
weighted bipartite graph(1). Once M is
F found assign a node u in V1 to the color in
1
V2 that M matches into, and for all the
1 remaining nodes in V1 not matched by M,
G 3 3
assign them consecutive colors one by
one starting from | V2 | + 1 onwards.
1

H 1 (1) Z. Galil, “Efficient Algorithms for Finding Maximum


Matching in Graphs,” ACM Computing Surveys, vol. 18,
March 1998, pp. 23-28. 3
Recoding on Node Join (Example)
A 1 The maximum matching M for this example is then {(A,2),
3 (B,3), (C,1)}. The color (code) assignment for the
unmatched nodes is (F,4), (G,5) and (H,6). This recoding
B strategy is local since the task of recoding the nodes in 1n U
3 2n U {n} is locally centralized at node n, and uses only local
2
3 information.
C Claims(1)
 Minimal Recoding: For the event where n joins the
network this algorithm recodes the minimum number
F 3 of nodes
 Optimal among Minimal: Among all minimal strategies
that recode nodes only one hop away from the event,
G e.g. nodes in 1n U 2n U {n}, this strategy re-assigns the
least maximum color to any node

H (1) I. Gupta, “Minimal CDMA Recoding Strategies in Power Controlled Ad-Hoc


Wireless Networks,” Technical Report, Dept. of Computer Science, Cornell
University, 2001. 3
Recoding on Node Join (Pseudo Code)
1. Obtain the constraints (u, oldcolor (v)) of the from-neighbors u of n,
u 1n  2 n , v 1n  2 n  {n}
2. Obtain the constraints (n, oldcolor (v)) for n, v 1n  2 n
3. Let max = maximum color seen in these constraints on old colors in 1 n U 2n
4. Let V1 = 1n U 2n U {n}, V2 = (1,2,…,max}
 Build the bipartite graph G’ by joining edges from each vertex v in V1 to each color k in V2
that it can be assigned without conflicting with the constraints with any of the nodes not
in 1n U 2n U {n}
 Assign a weight of 3 to the edge if it connects to the old color assigned to v, otherwise
assign it a weight of 1
5. Run the bipartite matching algorithm on G’
6. For each edge v in V1 that is matched to some edge k in V2 assign k as the new
color. For all the remaining m vertexes in V1 not assigned a color assigned them the
colors max + 1, …, max + m
7. Transmit this information to all concerned nodes and coordinate on when to change
colors
4
Recoding on Move
The event when a node n moves can be handled in almost the same way as when a
node joins the network, e.g. for the following example,

2
4n
A B 3
B

D
F 1
3 C
1 E
G 1n U 2n
3 2

1n = { }, 2n = {E,F,G}, 3n = { }, 4n = {A,D,C}. The original color assignment,


before node B moves, is indicated next to each node (in the square box).
4
Recoding on Move (Example)
The bipartite graph G’ is The maximum matching M is
1
B B
3
1 1

1
E E
3 3
2 2
3 3
F 1
F
1
3 3
3 3
G 1 G

The final color (code) is (A,2), (B,4), (C,1), (D,3), (E,3), (F,1), and (G,2)

4
Recoding on Node Move (Pseudo Code)
0. Define 1n, 2n, 3n, and 4n, for the node n in its new position
1. Obtain the constraints (u, oldcolor (v)) of the from-neighbors u of n,
u 1n  2 n , v 1n  2 n  {n}
2. Obtain the constraints (n, oldcolor (v)) for n,v 1n  2 n
3. Let max = maximum color seen in these constraints on old colors in 1 n U 2n
4. Let V1 = 1n U 2n U {n}, V2 = (1,2,…,max}
 Build the bipartite graph G’ by joining edges from each vertex v in V1 to each color
k in V2 that it can be assigned without conflicting with the constraints with any of
the nodes not in 1n U 2n U {n}
 Assign a weight of 3 to the edge if it connects to the old color assigned to v,
otherwise assign it a weight of 1
5. Run the bipartite matching algorithm on G’
6. For each edge v in V1 that is matched to some edge k in V2 assign k as the new
color. For all the remaining m vertexes in V1 not assigned a color assigned
them the colors max + 1, …, max + m
7. Transmit this information to all concerned nodes and coordinate on when to
change colors 4

You might also like