On the Complexity of Point Recolouring in Geometric Graphs

CCCG 2008, Montréal, Québec, August 13–15, 2008

**On** **the** **Complexity** **of** **Po int**

Henk Meijer

Roosevelt Academy

Middelburg, The Ne**the**rlands

h.meijer@roac.nl

Yurai Núñez-Rodríguez

Queen’s University

K**in**gston, ON Canada

yurai@cs.queensu.ca

David Rappaport ∗

Queen’s University

K**in**gston, ON Canada

daver@cs.queensu.ca

Abstract

Given a collection **of** po**in**ts represent**in**g geographic

data we consider **the** task **of** del**in**eat**in**g boundaries

based on **the** features **of** **the** po**in**ts. Assum**in**g that **the**

features are b**in**ary, for example, red or blue, this can be

viewed as determ**in****in**g red and blue regions, or states.

Due to regional anomalies or sampl**in**g error, we may

f**in**d that reclassify**in**g, or recolour**in**g, some po**in**ts may

lead to a more rational del**in**eation **of** boundaries. In

this note we study **the** maximal length **of** recolour**in**g

sequences where recolour**in**g rules are based on neighbour

relations and neighbours are def**in**ed by a geometric

graph. We show that **the** difference **in** **the** maximal

length **of** recolour**in**g sequences is strik**in**g, as it can

range from a l**in**ear bound for all trees, to an **in**f**in**ite

sequence for some planar graphs.

1 Introduction

Given a set **of** planar po**in**ts partitioned **in**to red and

blue subsets, a red-blue separator is a boundary that

separates **the** red po**in**ts from **the** blue ones. There has

been considerable **in**vestigation **of** methods for obta**in****in**g

such red-blue separat**in**g boundaries. In his PhD

**the**sis, Seara [8], exam**in**es various means for red-blue

separation. For **the** case **of** red-blue separation with **the**

m**in**imum perimeter polygon **the** problem is known to

be NP-hard [3, 1]. A somewhat related topic is to obta**in**

a balanced subdivision **of** red and blue po**in**ts, that

is, faces **of** **the** subdivision conta**in** a prescribed ratio

**of** red and blue po**in**ts. Kaneko and Kano [4] give a

comprehensive survey **of** results perta**in****in**g to red and

blue po**in**ts **in** **the** plane, **in**clud**in**g results on balanced

subdivisions.

For some applications one is will**in**g to reclassify

po**in**ts by recolour**in**g **the**m so as to obta**in** a more reasonable

boundary. For example Chan [2] shows that

f**in**d**in**g a red-blue separat**in**g l**in**e with **the** m**in**imum

number **of** reclassified po**in**ts takes O((n + k 2 ) log k) expected

time, where k is **the** number **of** recoloured po**in**ts.

In Re**in**bacher et al. [7] a heuristic algorithm is presented

for obta**in****in**g a better del**in**eat**in**g boundary that

∗ Supported by an NSERC **of** Canada Discovery Grant

recolours po**in**ts. The **in**put is a triangulated set **of** n

planar red-blue po**in**ts. For a po**in**t p to be recoloured

it needs to be “surrounded” by po**in**ts **of** **the** opposite

colour. Re**in**bacher et al. show experimental results on

del**in**eat**in**g boundaries after recolour**in**g.

A surrounded po**in**t is realized when **the**re is a contiguous

set **of** oppositely coloured neighbours **of** p, **in**

**the** triangulation, that span a radial angle greater than

180 ◦ . As **the** recolour**in**g occurs **in** an iterative sequence

it is not clear that **the** process will ever come to an

end. However, Re**in**bacher et al. show that no sequence

that iteratively recolours surrounded po**in**ts will

ever visit **the** exact same colour**in**g **of** **the** po**in**ts more

than once. Thus **the** maximum number **of** recolour**in**gs

is bounded by **the** total number **of** possible colour**in**gs

which is 2 n − 1. This bound was improved by Núñez-

Rodríguez and Rappaport [5] by prov**in**g that any recolour**in**g

sequence has O(n 2 ) length. This bound is, **in**

fact, tight.

In this note, we present bounds on recolour**in**g for

o**the**r types **of** geometric graphs. Our ma**in** results **in**clude

bounds on **the** number **of** recolour**in**gs for graphs

**of** maximum degree 3, bounds on **the** number **of** recolour**in**gs

**of** trees, and examples **of** **in**f**in**ite recolour**in**g

sequences on planar and non-planar graphs. Some **of**

our pro**of**s have been omitted because **of** space limitations.

In **the** next section we precisely describe **the** recolour**in**g

problem. We follow, **in** **the** subsequent section, with

our new results on **the** length **of** recolour**in**g sequences

**of** geometric graphs, such as planar graphs, non-planar

graphs, and trees. The last section discusses some extensions

**of** our results.

2 Prelim**in**aries

We are given as **in**put a draw**in**g **of** a graph, D = (S, E),

where S is a set **of** po**in**ts **in** **the** plane partitioned **in**to

blue po**in**ts and red po**in**ts and E ⊆ S × S is **the** set

**of** edges **of** **the** graph. The edges are represented by

straight l**in**e segments. An edge **in**cident to po**in**ts p

and q is denoted as pq. We assume throughout, for

simplicity **of** exposition, that **the** po**in**ts are **in** general

position. We colour **the** edges **of** D red if its two **in**cident

po**in**ts are red, and blue if its two **in**cident po**in**ts are

20th Canadian Conference on Computational Geometry, 2008

blue. If one **of** **the** **in**cident po**in**ts is red and **the** o**the**r

is blue we mix **the** colours to obta**in** a magenta edge.

Def**in**ition 1 Let **the** edges **of** D be coloured as above.

Then **the** magenta angle **of** a po**in**t p ∈ S is:

• 0 ◦ , if p has at most one radially consecutive **in**cident

magenta edge,

• 360 ◦ , if p has degree greater than one and is only

**in**cident to magenta edges,

• **the** maximum angle between two or more radially

consecutive **in**cident magenta edges, o**the**rwise.

Notice that, accord**in**g to **the** previous def**in**ition, a

po**in**t with only one neighbour **in** D has magenta angle

0 ◦ regardless **of** **the** colour **of** its neighbour (See Figure

1). A surrounded po**in**t is one with magenta angle larger

than 180 ◦ . Therefore, a po**in**t **of** degree zero or one is

never surrounded nor recoloured. We say an edge is **in**

**the** magenta angle **of** a po**in**t if it is **in**cident to **the** po**in**t

and falls with**in** **the** span **of** **the** magenta angle.

p

p

p

p

p

(a) (b) (c)

(d)

Figure 1: Examples **of** magenta angles α **of** po**in**t p.

Magenta angles larger than 0 ◦ are represented by arcs:

(a), (b) α = 0 ◦ , (c) α = 360 ◦ , (d), (e) 180 ◦ < α < 360 ◦ .

The strategy **of** reclassification by recolour**in**g, recolours

a surrounded po**in**t p at a time. The sequence **in**

which surrounded po**in**ts are recoloured can be driven

by a mixed criterion, such as recolour**in**g **the** surrounded

po**in**t with **the** largest magenta angle, or with **the** largest

number **of** edges **in** **the** magenta angle. Accord**in**g to

Re**in**bacher et al. [7], **the**re exist mixed criteria that

always produce recolour**in**g sequences **of** l**in**ear size. In

**the** sequel, we assume surrounded po**in**ts are recoloured

**in** an arbitrary manner, **in** order to f**in**d bounds for any,

and all, possible recolour**in**g strategies. The recolour**in**g

process stops when **the**re are no more surrounded

po**in**ts.

3 Bounded and Unbounded **Recolour ing** Sequences

At all times **the** graphs are assumed to be connected

because, **in** general, each connected component can be

considered **in**dependently. We use **the** term draw**in**g, to

refer to **the** draw**in**g **of** a graph as def**in**ed **in** **the** previous

section. There are families **of** draw**in**gs for which

every recolour**in**g sequence is f**in**ite and o**the**rs that allow

(e)

**in**f**in**ite recolour**in**g sequences. We characterize some **of**

**the**se families. A family **of** draw**in**gs with f**in**ite recolour**in**g

sequence comes from graphs with maximum degree

3.

Theorem 1 Let D be a draw**in**g with n bi-chromatic

po**in**ts. If D has maximum po**in**t degree 3, **the**n **the**

length **of** any recolour**in**g sequence **of** D is O(n).

The pro**of** **of** Theorem 1 only relies on **the** number

**of** po**in**t neighbours and **the** fact that **the** number **of**

magenta edges decreases with every recolour**in**g. Thus,

**the** result also holds for non-planar and more general

draw**in**gs with maximum degree 3.

3.1 Planar Draw**in**gs

As opposed to triangulations, planar draw**in**gs may have

non-convex faces and po**in**ts **of** degree one. **On**e may

th**in**k **of** obta**in****in**g bounds for planar graphs based on

**the** fact that a planar graph is a subgraph **of** a triangulation.

However, this does not seem to help s**in**ce **the**re

are simple examples where a subgraph can have ei**the**r a

larger or a smaller number **of** recolour**in**gs **in** **the** worst

case over all **in**itial colour**in**gs.

In fact, a recolour**in**g sequence **of** a planar graph can

be **in**f**in**ite. Figure 2 shows an example **of** a graph and a

colour configuration that lead to an **in**f**in**ite recolour**in**g

sequence. Observe from Figure 2 that **the** **in**itial colour**in**g

repeats after a number **of** steps (recolour**in**gs). Notice

that only certa**in** recolour**in**g sequences are **in**f**in**ite

**in** this example. The draw**in**g **in** Figure 2 can be made

2-connected and **the** m**in**imum po**in**t degree can be **in**creased

by carefully add**in**g more edges **in**cidents to **the**

po**in**ts **of** degree one, without affect**in**g **the** recolour**in**g

sequence.

3.2 Non-Planar Draw**in**gs

At this po**in**t, it is obvious that one can also construct

non-planar draw**in**gs with **in**f**in**ite recolour**in**g sequences

s**in**ce planar draw**in**gs allow so. Never**the**less, **the** examples

shown for **in**f**in**ite recolour**in**g sequences on planar

draw**in**gs **in**clude po**in**ts that never change colour. We

show an example **of** a non-planar draw**in**g with **in**f**in**ite

recolour**in**g sequence where every po**in**t changes colour

**in**f**in**itely many times (see Figure 3). If similar examples

can be built for planar draw**in**gs, **the**se have not yet

been found.

3.3 Trees

In this subsection we use **the** term tree draw**in**g to refer

to a straight l**in**e draw**in**g **of** a tree (not necessarily

planar). A trivial example **of** a tree draw**in**g that has

O(n) recolour**in**g sequence is a “jigsaw” path with po**in**ts

alternately coloured. In such example, all blue po**in**ts

CCCG 2008, Montréal, Québec, August 13–15, 2008

9

21

12

17

25

16

24

13

1

8

4

28

20

5

7

18

26

2

6

3

15

22

14

27

19

10

23

11

for triangulations (Theorem 9 [5]), with m**in**or modifications.

However, this bound is not tight. As a corollary

**of** Theorem 1 we have that b**in**ary tree draw**in**gs have

a l**in**ear number **of** recolour**in**gs. In **the** rema**in**der **of**

this section we prove that **the** number **of** recolour**in**gs **of**

general tree draw**in**gs is also l**in**ear.

In order to prove a tight bound (Theorem 4) for **the**

recolour**in**g **of** tree draw**in**gs, we def**in**e a partial order

on **the** recolour**in**gs **in**volved **in** a recolour**in**g sequence.

Then we bound **the** total number **of** recolour**in**gs based

on **the** number **of** m**in**imal elements (s**in**ks) **of** such partial

order. This idea is expla**in**ed and formalized **in** what

follows.

We denote a recolour**in**g event r, or simply a recolour**in**g,

as **the** event **of** a certa**in** po**in**t p chang**in**g colour.

Let R = (r 1 , . . . , r k ) be a recolour**in**g sequence where

r i denotes **the** recolour**in**g at step i, 1 ≤ i ≤ k, k > 0.

We also denote p(r) as **the** po**in**t that changes colour at

recolour**in**g r, and N(r) **the** number **of** times that p(r)

has changed colour **in** R prior to event r.

Def**in**ition 2 Let T be a tree draw**in**g and let R be a

recolour**in**g sequence **of** T . The history graph **of** R

is a directed graph H = (R, I), I ⊆ R × R such that

(r j , r i ) ∈ I if and only if p(r i )p(r j ) is **in** **the** magenta

angle associated to r j .

Figure 2: Planar draw**in**g D with **in**f**in**ite recolour**in**g

sequence. **Po int**s represented by smaller circles never

change colour. Top: **in**itial colour**in**g **of** D. Bottom:

D after 28 recolour**in**gs. The labels **in**dicate **the** order

**in** which po**in**ts are recoloured. Notice that **the** bottom

draw**in**g is a rotation **of** **the** top draw**in**g. This **in**dicates

that **the** recolour**in**gs can repeat **in**f**in**itely many times.

Figure 3: Non-planar draw**in**g D with **in**f**in**ite recolour**in**g

sequence. Left: **in**itial colour**in**g **of** D. Right: D

after 4 recolour**in**gs. The labels **in**dicate **the** order **in**

which po**in**ts are recoloured. Notice that **the** right draw**in**g

is a rotation **of** **the** left draw**in**g. This **in**dicates that

**the** recolour**in**gs can repeat **in**f**in**itely many times.

can be coloured to red, lead**in**g to approximately n/2

recolour**in**gs.

It is not hard to prove that **the** number **of** recolour**in**gs

**of** tree draw**in**gs is O(n 2 ) by **the** same arguments used

1

4

2

3

Observation 1 By **the** def**in**ition **of** history graph all

**the** edges are directed from later recolour**in**gs to earlier

ones. Therefore, a history graph is a directed acyclic

graph (DAG) and def**in**es a partial order on **the** elements

**of** **the** recolour**in**g sequence.

The follow**in**g lemma formally states that for two consecutive

recolour**in**gs **of** a po**in**t p to occur, it is required

that at least two neighbours **of** p change colour **in** between.

Lemma 2 Let T be a tree draw**in**g with n bi-chromatic

po**in**ts, let R be a recolour**in**g sequence **of** T , and let H =

(R, I) be **the** history graph **of** R. Consider a recolour**in**g

r ∈ R with N(r) > 0. Then **the** outdegree **of** r is at least

2. Moreover, **the**re exist two dist**in**ct neighbours **of** p(r),

p 1 , p 2 ∈ T , with recolour**in**gs s 1 , s 2 ∈ R, respectively,

such that (r, s 1 ) ∈ I and (r, s 2 ) ∈ I.

Pro**of**. Obviously, if a po**in**t is recoloured red (similarly

blue) and was recoloured earlier **in** **the** sequence, **the**

previous recolour**in**g was to blue (red). The **in**tersection

between **the** magenta angles at **the** time it is surrounded

by red (blue) and previously by blue (red) conta**in**s at

least two edges s**in**ce **the** correspond**in**g magenta angles

are greater than 180 ◦ . Therefore, **the**re are at least two

neighbours **of** p, p 1 , p 2 ∈ T that are recoloured at least

once between two consecutive recolour**in**gs **of** p. □

In **the** light **of** Lemma 2, we can state **the** follow**in**g

def**in**ition.

20th Canadian Conference on Computational Geometry, 2008

Def**in**ition 3 Let R be a recolour**in**g sequence **of** a tree

draw**in**g T and H = (R, I) be **the** correspond**in**g history

graph. The b**in**ary history graph **of** R, BH =

(R, BI), BI ⊆ I, is a subgraph **of** **the** history graph

where nodes have outdegrees 2 or 0: nodes with outdegree

0 correspond to first time recolour**in**gs; nodes with

outdegree 2 correspond to subsequent recolour**in**gs. Consider

a node r k **of** degree 2 **in** **the** b**in**ary history tree.

From Lemma 2 we know that **the**re are two dist**in**ct

neighbours **of** p(r k ) that have been previously recoloured.

Thus we choose **the** two outgo**in**g edges **of** r k (r k , r i ),

(r k , r j ), such that i and j are **the** largest **in**dices smaller

than k for neighbours **of** r k **in** **the** history graph where

p(r i ) ≠ p(r j ).

The motivation to def**in**e **the** b**in**ary history graph is

to obta**in** a cycle-free subgraph **of** **the** history graph that

**in**volves all **the** recolour**in**gs. This is formalized **in** **the**

next lemma.

Lemma 3 Let T be a tree draw**in**g, and R a recolour**in**g

sequence **of** T with b**in**ary history graph BH. BH has

no directed or undirected cycles. Therefore, BH is a

forest **of** trees.

To obta**in** a bound on **the** size **of** b**in**ary history trees

we show that **the** number **of** nodes is l**in**ear **in** **the** size

**of** **the** correspond**in**g tree draw**in**g. This will lead us to

conclude **the** results **of** **the** follow**in**g **the**orem.

Theorem 4 Let T be a tree draw**in**g with n bichromatic

po**in**ts. The length **of** any recolour**in**g sequence

**of** T is O(n).

4 Extensions

4.1 Surrounded Threshold Greater Than 180 ◦

Thus far we have assumed that a po**in**t is surrounded

when its magenta angle is any value greater than 180 ◦ .

Re**in**bacher et al. [7] show that a threshold value smaller

than 180 ◦ allows for **in**f**in**ite recolour**in**g sequences on

very simple graphs –trees **in**cluded. Some **of** our results

hold for threshold values α > 180 ◦ . Trees, for example,

have l**in**ear recolour**in**g sequences for any threshold

180 ◦ < α < 360 ◦ . Also Theorem 1 holds for any threshold

α > 0 ◦ . O**the**r results do not seem to hold for any

threshold value. For **in**stance, it is not clear how large

**the** value **of** α can be such that **in**f**in**ite recolour**in**g sequences

exist on planar graphs.

4.2 More than two colours

Suppose that **the** po**in**ts come **in** more than two colours.

We def**in**e **the** colour **of** an edge as **the** mixture **of** **the**

colours **of** its endpo**in**ts. In a multi-coloured scenario

we say that p is surrounded by a set **of** edges **of** a s**in**gle

mixed colour if **the** edges def**in**e a cont**in**uous angle

greater than 180 ◦ . As we may **in**tuitively observe, **in**creas**in**g

**the** number **of** colours only lowers **the** chances

**of** a po**in**t be**in**g surrounded without chang**in**g **the** fundamental

nature **of** **the** problem. In fact, **in**spection

shows that all **of** our previous results hold **in** a multicoloured

scenario. Thus, our recolour**in**g bounds for a

bi-chromatic set **of** po**in**ts carry over to multi-coloured

po**in**t sets.

5 Conclusions

We have re-exam**in**ed a po**in**t recolour**in**g method useful

for reclassify**in**g po**in**ts to obta**in** reasonable subdivid**in**g

boundaries. We show tight (l**in**ear) bounds on trees and

graphs **of** maximum degree 3 for **the** longest possible

sequence **of** recolour**in**gs. Planar and non-planar graphs

have been shown to have **in**f**in**itely many recolour**in**gs.

Some **in**terest**in**g questions rema**in** open. First, can

planar draw**in**gs have sequences **of** recolour**in**gs where all

**the** po**in**ts change colour **in**f**in**itely many times Also,

what is **the** complexity **of** po**in**t recolour**in**g **in** planar

draw**in**gs and o**the**r geometric graphs when **the** threshold

to consider a po**in**t as surrounded is greater than

180 ◦

References

[1] E. M. Ark**in**, S. Khuller, and J. S. B. Mitchell. **Geometric**

knapsack problems. Algorithmica, 10:399–427,

1993.

[2] T. M. Chan. Low-dimensional l**in**ear programm**in**g with

violations. **in** Proceed**in**gs **of** **the** 43rd IEEE Symposium

on Foundations **of** Computer Science, 570–579, 2002.

[3] P. Eades and D. Rappaport. The complexity **of** comput**in**g

m**in**imum separat**in**g polygons. Pattern Recogn.

Lett., 14:715–718, 1993.

[4] A. Kaneko and M. Kano. Discrete geometry on red

and blue po**in**ts **in** **the** plane —a survey. **in** Discrete

and Computational Geometry, The Goodman-Pollack

Festschrift, Algorithms and Comb**in**atorics, Spr**in**ger,

vol. 25, 551–570, 2003.

[5] Y. Núñez-Rodríguez, and D. Rappaport. Tight bounds

for po**in**t recolour**in**g. Proc. 18th Canadian Conf. **in**

Comp. Geometry (CCCG’06), K**in**gston, ON, Canada,

67–70, 2006.

[6] Joseph O’Rourke. Computational Geometry **in** C. Cambridge

University Press, 1998.

[7] Iris Re**in**bacher, Marc Benkert, Marc van Kreveld,

Joseph S.B. Mitchell, Jack Snoey**in**k, and Alexander

Wolff. Del**in**eat**in**g boundaries for imprecise regions. Algorithmica,

vol. 50:3, 386–414, 2008.

[8] Carlos Seara. **On** **Geometric** Separability. PhD. Thesis.

Universitat Politècnica De Catalunya, 2002.