Fuzzy

Array

Data-flow

Analysis

Part

II

Recursive

Programs

Albert

Cohen

Jean-Fran

cois

Collard

Abstract

This

paper

addresses

the

data-flow

analysis

of

access

to

arrays

in

recursive

imperative

programs

When

no

assumption

is

made

on

recursion

predicates

only

approximate

-LRB-

fuzzy

-RRB-

flow

information

can

be

hoped

for

in

the

general

case

However

we

introduce

a

new

data-flow

framework

based

on

push-down

automata

and

equivalently

on

context-free

grammars

and

show

that

this

framework

allows

to

describe

the

set

of

possible

sources

with

maximal

precision

Introduction

Automatic

parallelization

of

imperative

programs

heavily

relies

on

analyses

of

memory

accesses

Since

Bernstein

-LSB-

-RSB-

we

know

that

two

non-aliased

memory

accesses

can

be

executed

in

any

order

possibly

in

parallel

Two

accesses

are

aliased

if

both

refer

to

the

same

memory

cell

and

at

least

one

is

a

write

Several

kinds

of

analyses

of

memory

accesses

have

been

proposed

Points-to

analyses

compute

a

store

model

using

abstract

locations

-LSB-

-RSB-

Alias

analyses

compute

pairs

of

memory

accesses

that

are

or

may

be

aliased

-LSB-

-RSB-

Data-flow

analyses

find

for

a

given

read

of

a

given

memory

cell

the

last

previous

write

into

this

cell

This

last

previous

write

stored

the

value

being

visible

from

the

read

so

this

tells

us

how

a

value

flows

from

its

source

to

its

sinks

Therefore

data-flow

analyses

have

in

addition

to

alias

analyses

the

ability

to

pick

the

last

aliasing

write

according

to

the

execution

order

So

far

automatic

parallelization

for

imperative

languages

has

been

mainly

targetting

scientific

kernels

which

often

are

nests

of

for

loops

iterating

over

accesses

to

arrays

For

such

programs

-LRB-

with

additional

restrictions

on

loop

bounds

-RRB-

all

the

computations

executed

at

run-time

are

known

at

compile-time

Such

programs

thus

have

static

control

Several

array

data-flow

analyses

-LRB-

ADAs

-RRB-

have

been

proposed

for

static

programs

with

general

affine

array

subscripts

-LSB-

-RSB-

However

when

general

conditionals

and

while

loops

are

to

be

taken

into

account

the

exact

set

of

run-time

computations

obviously

can

not

be

statically

predicted

Array

data-flow

analyses

for

these

dynamic

control

programs

have

been

proposed

-LSB-

-RSB-

They

are

all

based

on

a

careful

coding

of

possible

execution

paths

as

integer

parameters

or

functions

and

return

conservative

sets

of

all

possible

sources

hence

their

name

Fuzzy

Array

Data-flow

Analyses

-LRB-

FADAs

-RRB-

When

addressing

recursive

programs

the

same

phenomena

occur

In

our

previous

work

on

the

subject

-LSB-

-RSB-

we

had

restricted

the

syntax

of

input

programs

so

as

to

only

handle

programs

with

static

recursive

control

This

paper

makes

the

same

improvement

to

dynamic

recursive

control

programs

as

FADAs

do

over

ADAs

The

programs

we

handle

are

non-mutual

recursive

programs

whose

array

subscripts

are

affine

functions

w.r.t

symbolic

constants

and

induction

variables

We

make

no

assumption

on

recursion

guards

The

contribution

of

this

paper

is

twofold

ffl

We

introduce

a

novel

framework

based

on

pushdown

automata

and

context-free

languages

to

express

sources

of

data

flows

ffl

We

prove

that

our

analysis

gives

the

best

possible

precision

that

can

be

achieved

without

any

information

on

recursion

guards

PRiSM

University

of

Versailles

Avenue

des

Etats-Unis

Versailles

France

This

paper

is

organized

as

follows

Section

presents

a

concrete

motivating

example

and

gives

a

flavour

of

how

our

analysis

works

Section

gives

definitions

and

notations

Section

gives

the

algorithm

of

our

analysis

Section

proves

that

this

analysis

is

correct

and

achieves

maximal

precision

Section

discusses

the

result

of

our

analysis

and

compares

our

work

with

related

research

A

Motivating

Example

procedure

F

-LRB-

l

r

-RRB-

begin

l

if

-LRB-

Pl

-RRB-

then

F

-LRB-

l

r

-RRB-

S

A

-LSB-

l-r

-RSB-

A

-LSB-

r-l

-RSB-

r

if

-LRB-

Pr

-RRB-

then

F

-LRB-

l

r

-RRB-

end

Figure

Motivating

Example

Procedure

F

l

r

rrlS

reads

A

-LSB-

-RSB-

lS

rllSlrlS

lrlrlS

lrrllS

rllrlS

rlrllS

Figure

Call

graph

for

procedure

F

and

possible

sources

of

rrlS

Consider

procedure

F

in

Fig.

Recall

that

throughout

this

paper

we

make

no

assumption

on

any

predicate

guarding

recursive

calls

such

as

Pl

and

Pr

Let

us

first

give

labels

to

every

statement

in

the

procedure

body

S

is

the

label

for

the

assignment

and

l

r

-LRB-

left

right

-RRB-

for

the

two

recursive

calls

in

the

binary

call

tree

respectively

A

part

of

this

call

tree

is

depicted

in

Fig.

A

statement

instance

is

labeled

with

the

control

word

-LRB-

sometimes

also

called

call

string

-RRB-

built

from

the

concatenation

of

labels

of

recursive

calls

and

finally

by

the

label

of

the

non-recursive

statement

at

hand

For

instance

consider

the

instance

of

S

executed

after

calls

along

r

r

and

l

This

instance

is

denoted

by

r

r

l

S.

Instance

r

r

l

S

reads

the

value

of

element

A

-LSB-

-RSB-

of

array

A

As

said

before

the

purpose

of

a

data-flow

analysis

is

to

find

the

instance

that

produced

that

value

i.e.

the

last

instance

that

wrote

into

A

-LSB-

-RSB-

A

possible

source

is

l

S

since

this

instance

did

write

into

A

-LSB-

-RSB-

-LRB-

All

square

nodes

in

the

trees

are

instances

that

wrote

into

A

-LSB-

-RSB-

before

r

r

l

S

reads

this

array

element

-RRB-

However

it

may

be

the

case

that

l

S

does

not

execute

i.e.

that

the

first

evaluation

of

Pl

returns

false

Now

consider

l

S

l

l

r

S

and

l

r

l

S.

All

of

them

write

into

A

-LSB-

-RSB-

l

r

l

S

is

the

latest

write

among

these

three

instances

but

here

again

we

can

not

be

sure

that

it

executes

so

the

write

in

l

S

may

or

may

not

be

killed

by

l

r

l

S.

On

the

contrary

we

can

not

be

sure

that

l

l

r

S

executes

but

if

it

does

then

l

S

executes

too

So

in

all

possible

executions

a

value

written

in

A

-LSB-

-RSB-

by

l

l

r

S

is

killed

by

l

S.

Therefore

l

l

r

S

never

can

be

the

source

of

the

read

in

r

r

l

S

In

the

figure

only

black

square

nodes

are

possible

sources

All

white

squares

are

alising

writes

which

always

are

killed

by

following

writes

and

should

thus

be

discarded

in

the

result

of

the

data-flow

analysis

We

thus

need

a

means

to

exactly

describe

black

square

nodes

in

the

call

tree

The

Fundamental

Idea

of

This

Paper

In

this

paper

we

present

a

novel

technique

to

exclude

instances

which

can

not

be

sources

-LRB-

such

as

l

l

r

S

in

the

exemple

-RRB-

from

the

result

of

the

data-flow

analysis

The

core

of

our

method

is

to

notice

that

all

possibles

sources

for

A

-LSB-

-RSB-

i.e.

all

black

square

nodes

in

Fig.

are

given

by

the

pushdown

automaton

depicted

in

The

stack

alphabet

is

fZ

I

Dg

where

Z

is

the

empty-stack

marker

We

assume

for

the

moment

that

we

are

looking

for

the

source

of

the

read

in

A

-LSB-

k

-RSB-

k

and

that

the

stack

is

initialized

with

Z

plus

k

times

the

letter

I.

Each

occurence

of

l

-LRB-

r

-RRB-

in

the

input

word

consumes

-LRB-

resp

pushes

-RRB-

one

I

from

-LRB-

to

-RRB-

the

stack

When

Z

appears

on

the

top

of

the

stack

then

the

letters

read

up

to

now

build

a

control

word

of

a

write

into

A

-LSB-

k

-RSB-

so

is

a

possible

source

From

this

point

no

word

with

prefix

l

can

be

source

because

the

value

written

by

such

words

will

always

be

overwritten

by

Words

starting

with

r

however

are

accepted

by

the

automaton

if

they

concatenate

to

as

many

l

's

as

r

's

From

this

pushdown

S

Z

I

Z

COUNT

ACCEPT

l

I

D

DD

r

D

I

II

Z

ZI

Figure

Pushdown

automaton

describing

the

black

squares

in

Figure

To

give

the

exact

sources

of

A

-LSB-

k

-RSB-

the

final

PDA

will

enforce

the

lexicographical

order

-LRB-

see

Section

-RRB-

Moreover

the

input

stack

is

depicted

here

for

A

-LSB-

-RSB-

automaton

a

context-free

grammar

can

be

derived

using

standard

algorithms

-LSB-

-RSB-

For

k

the

grammar

is

LA

S

L

l

j

rLL

A

rLA

j

Notice

that

transitions

using

D

are

not

used

when

k

Definitions

and

Program

Model

Definitions

An

n-ary

function

f

-LRB-

Cn

-RRB-

is

increasing

iff

Ci

-RRB-

f

-LRB-

Cn

-RRB-

f

-LRB-

Ci

Cn

-RRB-

A

decreasing

function

is

defined

in

a

similar

way

A

function

f

is

monotone

if

f

is

either

increasing

decreasing

or

a

-LRB-

numerical

or

symbolic

-RRB-

constant

The

set

of

assignments

labels

is

denoted

by

stmts

The

set

of

labels

of

recursive

calls

is

denoted

by

Cng

For

instance

fl

rg

in

procedure

F.

Any

execution

of

an

assignment

can

thus

be

uniquely

labeled

by

a

word

in

stmts

Such

a

word

is

called

a

control

word

-LRB-

or

sometimes

in

the

literature

a

call

string

-RRB-

To

make

explicit

that

a

word

w

labels

an

instance

of

some

statement

s

stmts

we

denote

this

instance

by

hs

wi

Variables

on

-LRB-

or

stmts

-RRB-

are

denoted

by

letters

u

v

z

and

variables

in

-LSB-

stmts

by

greek

letters

ff

Note

that

we

sometimes

overload

operator

to

mean

inclusion

E.g.

u

l

actually

means

u

l

v

The

textual

order

on

labels

is

denoted

by

C.

For

example

l

C

S

C

r

in

Figure

We

define

the

following

sets

f

j

B

f

j

C

Intuitively

they

correspond

to

labels

appearing

textually

after

and

before

the

label

of

assignment

In

procedure

F

for

instance

AS

f

j

fl

rg

B

Sg

frg

The

order

OE

in

which

instances

are

executed

is

thus

simply

given

by

the

usual

lexicographical

order

-LRB-

the

alphabetical

order

of

the

dictionary

-RRB-

denoted

o

on

corresponding

control

words

stmts

To

see

this

consider

binary

recursion

the

execution

orders

for

pre-order

in-order

and

post-order

traversal

are

just

given

by

different

textual

orders

Let

w

be

two

words

labeling

instances

of

statements

S

and

respectively

-LRB-

so

w

S

and

-RRB-

Then

o

w

w

u

ff

v

u

and

C

-LRB-

-RRB-

Notice

that

C

yields

several

disjuncts

In

the

case

of

binary

in-order

traversal

in

procedure

F

C

-LRB-

l

S

-RRB-

-LRB-

l

r

-RRB-

-LRB-

S

r

-RRB-

obviously

yielding

as

many

disjuncts

when

decomposing

o

w

The

latter

disjuncts

are

indexed

by

i

and

denoted

by

di

-LRB-

w

-RRB-

in

the

sequel

Finally

we

denote

by

jwj

the

length

of

word

w

by

jwjCi

the

number

of

occurrences

of

letter

Ci

in

word

w

and

by

jwjS

the

number

of

occurences

in

w

of

any

letter

in

a

set

S.

Obviously

w

-RRB-

jwj

jwj

P

jwjCi

Numbered

occurrences

languages

To

describe

sets

of

words

w

defined

by

properties

on

jwjCi

Ci

the

following

definitions

-LSB-

-RSB-

are

in

order

here

ffl

The

pumping

-LSB-

Cinn

-RSB-

of

an

alphabet

Cng

by

a

mapping

of

into

Zwhich

maps

Cj

into

ij

is

the

language

built

of

all

words

containing

exactly

ij

occurrences

of

Cj

for

all

j.

ffl

An

affine

parameterized

pumping

denoted

by

-LSB-

Cinn

-RSB-

D

-LRB-

in

-RRB-

is

the

union

of

all

pumpings

such

that

parameters

in

satisfy

the

system

D

of

affine

-LRB-

in

-RRB-

equalities

ffl

a

numbered

occurrences

language

NOL

is

given

by

p

words

wp

-LRB-

possibly

empty

-RRB-

p

pumpings

Pp

and

a

conjunction

D

of

affine

-LRB-

in

-RRB-

equalities

A

NOL

is

denoted

by

L

wp

Pp

wp

D

Notice

that

several

pumpings

in

an

NOL

may

share

integer

parameters

that

are

constrained

by

D.

Program

Model

In

this

paper

we

consider

programs

built

of

a

single

non-mutually

recursive

procedure

whose

body

ffl

Includes

n

recursive

calls

ffl

Includes

at

least

one

statement

call

it

S

reading

into

A.

ffl

Includes

exactly

one

assignment

call

it

writing

into

A.

ffl

Access

to

a

single

one-dimensional

array

A.

Subscripts

are

affine

functions

w.r.t.

symbolic

constants

and

induction

variables

so

they

can

be

expressed

as

affine

functions

w.r.t.

symbolic

constants

and

occurence

numbers

of

recursion

labels

in

control

word

w

We

denote

by

f

c

-LRB-

g

d

-RRB-

the

linear

and

constant

parts

of

the

subscript

to

array

A

in

the

left

-LRB-

right

-RRB-

hand

side

of

statement

-LRB-

S

-RRB-

Extending

This

Model

Let

us

stress

that

extending

the

program

model

above

Is

trivial

when

several

arrays

are

used

there

obviously

is

one

application

of

the

analysis

for

each

read

statement

to

each

array

Is

easy

when

several

write

assignments

to

A

appear

the

lexicographical

order

is

more

intricate

and

the

analysis

is

conceptually

the

same

except

that

we

have

to

combine

the

results

for

all

assignments

to

A

This

problem

is

not

addressed

here

Is

easy

too

when

array

A

is

multi-dimensional

and

at

least

one

dimension

is

subscripted

by

a

monotone

function

In

this

case

the

set

of

solutions

is

exactly

given

by

a

NOL

and

this

set

is

bounded

Unfortunately

if

this

condition

is

not

true

i.e.

if

A

is

multi-dimensional

and

all

dimensions

have

a

non-monotone

subscript

one

context-free

grammar

is

given

for

each

dimension

Two

array

references

being

aliased

if

subscripts

in

all

dimensions

are

equal

sources

would

be

given

by

intersecting

all

CFGs

But

CFGs

are

not

closed

under

intersection

We

come

back

to

this

point

in

Section

Data-flow

Analysis

The

purpose

of

data-flow

analysis

is

to

find

for

any

read

in

a

given

operation

which

previous

write

produced

the

read

value

Let

S

-LRB-

resp

-RRB-

be

a

statement

reading

-LRB-

resp

writing

into

-RRB-

array

A

and

whose

control

word

is

w

-LRB-

resp

-RRB-

Array

subscripts

are

assumed

to

be

functions

of

induction

variables

So

for

any

instance

hS

wi

of

statement

S

we

are

looking

for

the

last

instance

of

that

wrote

into

A

-LSB-

g

-LRB-

w

-RRB-

d

-RSB-

i.e.

such

that

f

-LRB-

-RRB-

c

g

-LRB-

w

-RRB-

d

-LRB-

-RRB-

hS

wi

is

called

the

sink

and

the

source

When

clear

from

the

context

both

S

and

will

be

dropped

from

the

notations

The

General

Framework

The

framework

in

which

our

data-flow

analysis

is

phrased

first

developed

by

Feautrier

-LSB-

-RSB-

consists

in

two

steps

For

a

given

statement

S

ffl

Construct

the

set

of

instances

of

that

are

possible

sources

of

hS

wi

This

set

-LRB-

w

-RRB-

is

built

from

all

operations

such

that

-LRB-

-RRB-

is

actually

executed

-LRB-

-RRB-

writes

into

the

memory

cell

that

hS

wi

reads

i.e.

-LRB-

-RRB-

holds

-LRB-

-RRB-

executes

before

hS

wi

written

OE

hS

wi

ffl

The

source

is

-LRB-

w

-RRB-

-LRB-

w

-RRB-

-LRB-

-RRB-

It

may

be

the

case

that

the

source

does

not

exist

-LRB-

w

-RRB-

then

by

definition

equals

to

the

undefined

operation

By

convention

is

the

earliest

operation

in

the

program

i.e.

stmts

OE

hs

wi

hs

wi

Notice

that

is

different

from

the

empty

word

The

former

defines

the

conventional

non-existing

statement

instance

the

latter

the

initial

procedure

call

i.e.

the

root

of

the

call

tree

Because

of

the

structure

of

the

lexicographical

order

-LRB-

-RRB-

we

have

to

split

-LRB-

w

-RRB-

into

n

subsets

of

possible

sources

-LRB-

w

-RRB-

-LRB-

w

-RRB-

along

each

disjunct

of

o

We

solve

them

in

turn

the

results

being

-LRB-

w

-RRB-

-LRB-

w

-RRB-

-LRB-

w

-RRB-

maxo

-LRB-

-LRB-

w

-RRB-

-RRB-

-LRB-

-RRB-

Each

-LRB-

w

-RRB-

is

a

nested

conditional

whose

predicates

depend

on

w

and

whose

leaves

include

the

maximum

element

according

to

order

OE

We

then

combine

the

intermediate

results

in

any

order

using

rules

similar

to

those

given

in

-LSB-

-RSB-

two

intermediate

results

are

merged

by

plugging

one

of

them

at

the

other

's

leaves

Leaves

are

equal

to

the

lexicographical

maximum

of

the

two

corresponding

leaves

Leaves

governed

by

contradictory

predicates

are

dismissed

Obviously

this

phase

has

to

be

repeated

for

all

possible

statements

and

the

intermediate

results

have

to

be

combined

The

Case

of

Dynamic

Control

In

this

paper

we

can

not

pick

the

last

element

in

a

set

of

instances

according

to

the

execution

order

because

we

do

n't

know

at

compile

time

whether

all

instances

in

the

set

actually

execute

So

we

ca

n't

solve

Eq

-LRB-

-RRB-

nor

Eq

-LRB-

-RRB-

Without

assumption

on

recursion

predicates

we

only

can

take

benefit

of

some

parent-child

-LRB-

ancestor-descendant

-RRB-

properties

on

nodes

in

the

call

tree

Formally

these

rules

are

Rule

If

oe

-LRB-

w

-RRB-

then

b

u

oe

-LRB-

w

-RRB-

Rule

says

that

all

writes

in

left

descendants

of

a

possible

source

are

always

overwritten

Rule

Let

the

NOL

N

be

a

set

of

candidate

sources

of

the

form

w

b

v

S

and

an

ancestor

of

w

of

the

form

w

S

v

b

then

if

no

write

in

N

is

a

possible

source

-LRB-

formally

N

w

oe

-LRB-

w

-RRB-

-RRB-

Notice

that

softwares

like

PIP

-LSB-

-RSB-

or

Omega

-LSB-

-RSB-

automatically

derive

inequalities

such

as

and

characterize

their

validity

domain

Notice

also

that

Rule

when

compared

to

Rule

is

expressed

w.r.t.

w.

To

see

this

consider

procedure

G

and

the

corresponding

call

tree

in

Figure

Assume

we

are

looking

for

the

source

of

the

read

in

w

r

l

l

S

reading

A

-LSB-

-RSB-

The

source

has

to

be

approximated

as

being

fl

l

S

l

r

S

g

i.e.

the

union

of

and

the

NOL

l

-LSB-

li

-RSB-

i

S.

On

the

contrary

we

would

like

to

prove

that

the

source

of

w

r

l

r

S

exactly

is

r

l

S

because

r

l

S

always

executes

when

r

l

r

S

does

and

killed

all

previous

writes

into

memory

cell

A

-LSB-

-RSB-

How

can

we

prove

this

Rule

ca

n't

prove

that

l

r

S

is

not

a

source

of

r

l

r

S

because

we

can

not

assume

a

priori

the

existence

of

r

l

S

This

assumption

however

is

true

when

considering

the

source

of

w

r

l

r

S.

Hence

the

need

for

Rule

procedure

G

-LRB-

p

-RRB-

begin

l

if

-LRB-

Pl

-RRB-

then

G

-LRB-

p

-RRB-

S

A

-LSB-

p

-RSB-

A

-LSB-

-RSB-

r

if

-LRB-

Pr

-RRB-

then

G

-LRB-

p

-RRB-

end

Figure

Second

Example

Procedure

G

The

rules

below

are

slight

modifications

of

the

previous

rule

r

l

Source

of

rlrS

l

r

Sources

of

rllS

lrSllS

rllS

rlrS

Figure

Call

tree

of

procedure

G.

Rule

If

w

S

and

w

S

v

then

if

can

not

be

a

source

of

w

-LRB-

oe

-LRB-

w

-RRB-

-RRB-

Rule

If

w

x

y

S

x

y

and

x

oe

-LRB-

w

-RRB-

then

oe

-LRB-

w

-RRB-

The

Algorithm

Intuition

of

the

Algorithm

In

the

first

step

of

the

algorithm

we

construct

sets

of

possible

sources

Theses

sets

are

NOLs

like

l

-LSB-

li

-RSB-

i

S

for

w

r

l

l

S

in

procedure

G.

Among

these

possible

sources

we

can

not

pick

the

last

element

-LRB-

because

existence

of

instances

is

not

proved

-RRB-

However

we

can

check

whether

Rules

or

apply

Notice

that

always

is

a

possible

source

except

when

an

ancestor

is

a

candidate

source

-LRB-

Rule

-RRB-

In

the

second

step

of

the

algorithm

if

the

array

subscript

in

the

left-hand

side

of

the

assignment

is

a

non-monotone

function

then

we

know

that

NOLs

over-approximate

the

set

of

possible

sources

and

that

they

can

be

improved

using

pushdown

automata

Thus

we

construct

the

corresponding

automaton

and

then

convert

the

PDA

into

a

context-free

grammar

using

classical

algorithms

-LSB-

-RSB-

Step

One

Building

NOLs

The

algorithm

is

as

follows

Input

Alphabet

of

call

labels

assigment

label

S

the

textual

order

C

on

all

labels

Output

Nested

conditionals

whose

predicates

are

pattern

matchings

on

w

and

leaves

are

NOLs

First

Step

of

the

Algorithm

-LRB-

Construct

intermediate

results

-RRB-

For

each

disjunct

di

-LRB-

w

-RRB-

of

the

lexicographical

order

do

-LRB-

a

-RRB-

Build

Qi

-LRB-

w

-RRB-

j

di

-LRB-

w

-RRB-

f

-LRB-

-RRB-

c

g

-LRB-

w

-RRB-

dg

-LRB-

b

-RRB-

Simplify

constraints

-LRB-

perhaps

using

PIP

or

Omega

-RRB-

This

yields

conditional

Ki

-LRB-

w

-RRB-

whose

leaves

are

NOLs

-LRB-

Combine

intermediate

results

-RRB-

Two

intermediate

results

are

combined

by

-LRB-

a

-RRB-

Nesting

the

two

conditionals

into

a

conditional

where

leaves

are

paired

then

eliminating

branches

governed

by

contradictory

predicates

-LRB-

b

-RRB-

Merging

paired

leaves

Merging

two

paired

leaves

-LRB-

which

are

NOLs

-RRB-

N

and

N

is

done

by

taking

the

union

N

-LSB-

N

except

when

we

can

prove

that

one

leaf

say

N

is

an

ancestor

of

sink

w

This

is

done

using

Rules

and

Example

We

apply

the

first

step

of

the

algorithm

to

procedure

G

Disjuncts

of

lexicographical

order

are

-LRB-

w

-RRB-

-LRB-

u

S

w

u

r

v

S

-RRB-

-LRB-

w

-RRB-

-LRB-

u

l

S

w

u

r

v

S

-RRB-

and

-LRB-

w

-RRB-

-LRB-

w

u

S

u

l

S

-RRB-

So

-LRB-

w

-RRB-

jwjr

jwjl

u

S

w

u

r

v

S

which

implies

jvjr

jvjl

Thus

jvjr

jvjl

So

the

first

intermediate

result

-LRB-

w

-RRB-

if

w

u

r

S

then

u

S

else

The

second

set

is

-LRB-

w

-RRB-

jvjr

jvjl

l

S

w

r

v

S

so

jvjr

jvjl

Therefore

-LRB-

w

-RRB-

if

w

r

v

S

jvj

then

l

-LSB-

ri

lj

-RSB-

i

j

jvjr

jvjl

S

else

Finally

-LRB-

w

-RRB-

which

is

empty

so

-LRB-

w

-RRB-

Combining

-LRB-

w

-RRB-

and

-LRB-

w

-RRB-

we

have

if

w

u

r

S

then

if

w

r

v

S

jvj

then

merge

-LRB-

u

S

l

-LSB-

ri

lj

-RSB-

i

j

jvjr

jvjl

S

-RRB-

else

merge

-LRB-

u

s

-RRB-

else

etc

-LRB-

-RRB-

The

predicates

governing

the

first

leaf

of

the

resulting

conditional

imply

x

w

r

x

r

S

so

applying

Rule

yields

r

x

r

r

and

Thus

the

first

merge

is

equal

to

u

S

The

second

merge

is

solved

using

Rule

Thus

-LRB-

-RRB-

if

w

u

r

S

then

if

w

r

v

S

then

u

S

else

u

S

else

etc

Since

for

any

predicate

P

if

P

then

x

else

x

can

be

replaced

by

x

-LRB-

-RRB-

if

w

u

r

S

then

u

S

else

etc

We

can

thus

conclude

that

among

other

properties

any

read

whose

label

ends

with

r

S

exactly

has

one

source

-LRB-

its

parent

node

-RRB-

excluding

-LRB-

so

the

memory

cell

being

read

is

always

initialized

-RRB-

Step

Two

Building

the

Pushdown

Automaton

Input

Alphabet

of

call

labels

assigment

label

S

the

textual

order

C

on

all

labels

subscripts

-LRB-

f

g

c

d

-RRB-

nested

conditionals

whose

predicates

are

pattern

matchings

on

w

and

leaves

are

NOLs

-LRB-

output

of

Step

One

-RRB-

Output

Nested

conditionals

whose

predicates

are

pattern

matchings

on

w

and

leaves

are

Context-free

grammars

-LRB-

CFGs

-RRB-

Let

us

consider

a

NOL

of

some

leaf

of

the

nested

conditional

corresponding

to

a

given

decomposition

of

w

and

defined

by

the

choice

of

and

We

show

that

it

is

possible

to

build

a

pushdown

automaton

ujffv

for

all

u

v

and

such

that

u

is

a

candidate

source

for

w

u

ff

v.

To

do

this

we

have

to

ensure

that

-LRB-

-RRB-

-RRB-

g

-LRB-

u

-RRB-

g

-LRB-

-RRB-

g

-LRB-

v

-RRB-

d

f

-LRB-

u

-RRB-

f

-LRB-

-RRB-

f

-LRB-

-RRB-

c

The

automaton

computes

the

left-hand

side

of

the

equality

letter-wise

and

a

necessary

condition

for

words

to

be

accepted

is

that

this

left-hand

side

is

eventually

equal

to

Note

that

ff

v

ends

with

the

sink

label

-LRB-

we

called

it

S

-RRB-

therefore

no

separation

symbol

-LRB-

like

j

-RRB-

is

needed

between

ff

v

and

When

the

candidate

source

is

an

ancestor

of

the

sink

and

the

associated

j

is

a

separator

leaf

in

the

conditional

is

not

a

NOL

-LRB-

it

is

a

single

word

-RRB-

so

we

do

not

have

to

recognize

sources

of

this

kind

in

the

automaton

and

we

suppose

that

The

intuitive

mechanism

of

the

automaton

consists

in

three

steps

Read

prefix

u

and

code

on

the

stack

the

value

of

conflict

function

g

-LRB-

u

-RRB-

f

-LRB-

u

-RRB-

d

c.

Stop

when

reading

the

j

symbol

Read

Then

read

v

and

code

on

the

stack

the

value

of

conflict

function

g

-LRB-

u

-RRB-

f

-LRB-

u

-RRB-

g

-LRB-

v

-RRB-

g

-LRB-

-RRB-

d?c

Stop

when

reading

S

-LRB-

note

that

may

be

equal

to

S

then

no

v

need

to

be

read

in

this

case

-RRB-

Read

-LRB-

The

input

NOL

enforces

that

C

-RRB-

Then

read

and

code

g

-LRB-

u

-RRB-

g

-LRB-

-RRB-

g

-LRB-

v

-RRB-

d?f

-LRB-

u

-RRB-

f

-LRB-

-RRB-

f

-LRB-

-RRB-

c

on

the

stack

but

ensure

that

the

write

is

not

killed

by

not

accepting

letters

such

that

C

S

when

the

conflict

function

is

equal

to

zero

-LRB-

i.e.

when

the

conflict

predicate

is

true

-RRB-

Finally

read

at

any

time

when

the

conflict

funtion

is

zeroed

It

is

easy

to

see

that

the

essential

function

of

our

automaton

is

to

memorize

-LRB-

in

the

stack

-RRB-

the

current

value

of

the

conflict

function

and

to

add/subtract

constants

to

it

This

general

pushdown

automaton

is

built

from

four

elementary

automata

as

basic

blocks

-LRB-

See

Figure

-RRB-

Automaton

shift

reads

a

given

letter

and

updates

the

stack

according

to

it

The

integer

value

of

the

conflict

function

is

coded

by

its

unary

decomposition

with

symbol

I

-LRB-

increment

-RRB-

for

positive

numbers

and

symbol

D

-LRB-

decrement

-RRB-

for

negative

ones

Adding

a

positive

constant

n

to

a

positive

counter

simply

consists

in

pushing

n

symbols

I

on

the

stack

and

subtracting

a

positive

constant

n

to

a

positive

number

is

coded

by

popping

n

symbols

I

from

the

stack

For

a

negative

counter

D

is

pushed

when

subtracting

n

and

popped

when

adding

n

A

special

case

appears

when

trying

to

subtract

n

to

a

positive

counter

m

with

m

n

-LRB-

and

when

adding

n

to

a

negative

counter

m

with

m

n

-RRB-

To

handle

this

a

stack-bottom

symbol

Z

-LRB-

zero

-RRB-

is

used

to

detect

sign

changes

Finally

we

would

like

to

use

the

shift

automaton

like

an

elementary

module

to

build

our

general

automaton

if

f

-LRB-

cn

-RRB-

ancn

is

a

linear

function

of

the

occurence

numbers

of

labels

Cn

shift

-LRB-

f

Cl

-RRB-

is

the

shift

automaton

which

reads

Cl

and

adds

the

corresponding

al

-LRB-

possibly

negative

-RRB-

to

the

counter

See

Figure

Automaton

stay

-LRB-

c

-RRB-

adds

c

to

the

counter

but

does

not

read

any

letter

-LRB-

it

is

needed

for

initialization

-RRB-

Automaton

count

-LRB-

f

-RRB-

reads

repeatedly

any

label

Cn

and

updates

the

stack

according

to

the

relevant

coefficient

in

f

It

is

a

kind

of

iteration

of

the

shift

automaton

Automaton

select

-LRB-

f

-RRB-

accepts

exactly

the

same

input

as

count

-LRB-

f

-RRB-

except

that

it

requires

that

a

label

Ck

B

is

read

every

time

the

stack

bottom

is

reached

It

simulates

this

way

the

selection

of

labels

greater

than

the

source

statement

in

the

local

execution

order

whenever

the

conflict

predicate

is

verified

Using

these

modules

we

can

easily

express

the

general

automaton

-LRB-

which

depends

on

f

g

and

-RRB-

Firstly

modules

stay

-LRB-

d?c

-RRB-

and

count

-LRB-

g

f

-RRB-

implement

the

first

step

Modules

shift

-LRB-

g

-RRB-

and

count

-LRB-

g

-RRB-

implement

the

second

step

when

and

the

state

QS

is

used

when

S.

Finally

modules

shift

-LRB-

f

-RRB-

and

select

-LRB-

f

-RRB-

implement

the

third

step

The

automaton

accepts

the

input

word

when

in

ACCEPT

state

with

empty

stack

See

Figure

Correctness

and

Precision

The

result

of

a

fuzzy

data-flow

analysis

is

for

any

given

read

in

instance

w

a

set

oe

-LRB-

w

-RRB-

of

possible

sources

The

analysis

has

to

be

both

correct

and

as

precise

as

possible

Definition

-LRB-

Correctness

-RRB-

A

data-flow

analysis

is

correct

if

for

any

execution

of

the

input

program

the

actual

source

of

a

read

w

is

in

oe

-LRB-

w

-RRB-

D

Z

ZI

I

II

OUT

IN

D

Z

ZI

I

II

IN

OUT

IN

D

I

I

Z

ZD

;D

DD

count

-LRB-

f

-RRB-

count

OUT

IN

D

Z

ZI

I

II

select

select

-LRB-

f

-RRB-

OUT

IN

I

Z

ZD

;D

DD

D

Z

ZI

I

II

I

II

Z

ZI

D

DD

if

c

if

c

if

c

IN

Qini

Qjnj

Qini

Qjnj

OUT

OUT

Q

Q

if

al

if

al

if

al

Q

nl

Q?nl

stay

-LRB-

c

-RRB-

Cl

I

Cl

D

I

II

Z

ZI

D

DD

Z

ZD

shift

-LRB-

f

Cl

-RRB-

Ci

D

I

II

Z

ZI

D

DD

Z

ZD

Cj

I

D

DD

Cj

B

Z

ZD

Ci

D

I

II

Ci

B

Z

ZI

Ck

Ck

I

I

D

D

Ck

B

Z

Z

Cl

Cj

I

Q

Q

c

Q

c

Q

Z

ZD

an

are

the

coefficients

of

subscript

function

f

-LRB-

given

in

argument

of

shift

count

and

select

-RRB-

and

nk

jakj

fCig

fCjg

and

fCkg

partition

the

recursive

call

labels

such

that

ai

aj

and

ak

-LRB-

The

character

is

a

wildcard

standing

for

any

stack

symbol

-RRB-

Figure

The

stay

shift

count

and

select

automata

Definition

-LRB-

Precision

-RRB-

A

data-flow

analysis

achieves

maximal

precision

if

for

any

element

in

oe

-LRB-

w

-RRB-

there

is

a

dynamic

execution

of

the

input

program

such

that

the

source

of

w

is

We

prove

the

following

lemmas

Lemma

The

analysis

is

correct

Proof

All

instances

satisfying

necessary

conditions

are

in

-LRB-

w

-RRB-

The

only

discarded

writes

are

those

satisfying

either

rules

and

Lemma

The

analysis

gives

the

best

possible

precision

Proof

The

only

writes

which

in

all

possible

executions

are

overwritten

are

those

for

which

there

exists

an

ancestor

of

w

writting

in

the

memory

cell

being

read

and

executing

between

and

w

This

is

taken

into

account

by

Rules

and

Rule

is

enforced

in

automaton

select

Rules

and

are

implemented

in

Point

-LRB-

b

-RRB-

of

the

first

step

of

the

algorithm

-LRB-

Section

-RRB-

Therefore

for

every

candidate

source

of

an

instance

w

belonging

to

the

set

characterized

by

the

data-flow

analysis

there

exists

an

execution

of

the

input

program

such

that

is

the

actual

source

of

w.

count

-LRB-

g

-RRB-

j

count

-LRB-

g

f

-RRB-

stay

-LRB-

d

c

-RRB-

stack

Z

shift

-LRB-

g

-RRB-

j

QS

S

Z

if

ACCEPT

The

automaton

below

accepts

words

ujffv

u

-LSB-

fSg

ff

v

S

S

if

S

shift

-LRB-

f

-RRB-

select

-LRB-

f

-RRB-

Figure

The

general

automaton

Note

that

in

our

sense

maximal

precision

is

defined

independently

of

any

knowledge

of

the

conditional

predicates

governing

the

recursive

calls

Thus

other

analyses

may

provide

more

precision

in

assuming

some

properties

on

these

conditionals

Discussion

and

Future

Work

Exploiting

Context-free

Grammars

Using

CFGs

as

output

of

the

data-flow

analysis

has

several

benefits

ffl

Checking

that

two

instances

form

a

source-sink

pair

is

decidable

Note

that

decision

algorithms

on

unrestricted

context-free

grammars

are

not

polynomial

But

the

associated

push-down

automata

considered

here

yields

a

linear

acceptation/rejection

time

of

source-sink

pairs

ffl

Proving

that

the

set

of

candidate

sources

is

empty

finite

or

infinite

is

also

decidable

-LSB-

-RSB-

This

result

is

very

interesting

for

optimization

and

parallelization

ffl

Context-free

grammars

are

closed

under

union

then

results

form

successive

application

of

the

analysis

on

different

parts

of

the

code

-LRB-

or

simply

for

multiple

source

statements

-RRB-

may

be

combined

together

ffl

Notice

finally

that

most

algorithms

to

convert

PDAs

into

CFGs

yield

grammars

whose

number

of

non-terminals

is

proportional

to

the

number

of

states

in

the

automaton

at

power

However

most

generated

non-terminals

are

not

reachable

and

are

thus

eventually

discarded

in

the

algorithm

in

-LSB-

-RSB-

Generalization

to

Multi-dimensionnal

Arrays

Suppose

the

array

subscripts

are

of

the

form

A

-LSB-

-LRB-

-RRB-

fm

-LRB-

xm

-RRB-

-RSB-

where

fm

are

affine

functions

We

can

extend

the

first

phase

of

the

analysis

to

such

arrays

by

intersecting

the

NOLs

for

each

dimension

yielding

a

NOL

with

a

conjunction

of

affine

-LRB-

in

-RRB-

equalities

Considering

a

write

assignment

to

array

A

if

at

least

one

subscript

function

fj

is

monotone

it

is

easy

to

see

that

no

further

refinement

can

be

performed

But

when

all

subscript

functions

are

non-monotone

some

write

instances

described

by

the

NOL

might

be

overwritten

by

an

ancestor

of

the

sink

instance

The

NOL

characterization

does

not

achieves

maximal

precision

in

this

case

On

the

other

side

context-free

languages

are

not

closed

under

intersection

but

the

intersection

of

CFLs

and

some

classes

of

languages

-LRB-

among

which

regular

languages

-RRB-

are

CFLs

-LSB-

-RSB-

Thus

for

the

moment

when

every

subscript

function

of

the

write

assignment

is

non-monotone

the

result

of

the

analysis

can

not

be

expressed

without

losing

precision

we

may

either

choose

to

keep

only

NOLs

as

leaves

of

the

nested

conditional

or

convert

some

grammars

to

left

-LRB-

or

right

-RRB-

regular

form

-LRB-

to

get

regular

languages

for

example

-RRB-

in

order

to

keep

context-free

languages

Comparison

of

the

two

solutions

is

left

for

future

work

Conclusion

This

paper

addresses

the

data-flow

analysis

of

access

to

arrays

in

recursive

imperative

programs

When

no

assumption

is

made

on

recursion

predicates

only

approximate

-LRB-

fuzzy

-RRB-

flow

information

can

be

hoped

for

in

general

However

we

introduce

a

new

data-flow

framework

based

on

context-free

languages

and

show

that

this

framework

allows

to

exactly

describe

the

set

of

possible

sources

We

believe

that

this

quite

surprising

result

paves

the

way

to

interesting

and

fruitful

research

in

the

field

of

data-flow

analyses

References

-LSB-

-RSB-

A.

J.

Bernstein

Analysis

of

programs

for

parallel

processing

IEEE

Trans

on

El

Computers

-LSB-

-RSB-

B.

Steengaard

Points-to

analysis

in

almost

linear

time

In

ACM

Symp

on

Principles

of

Programming

Languages

-LSB-

-RSB-

W.

L.

Harrison

III

An

efficient

approach

to

computing

fixpoints

for

complex

program

analysis

Journal

of

Programming

Languages

-LCB-

March

-LSB-

-RSB-

A.

Deutsch

Interprocedural

may-alias

analysis

for

pointers

beyond

k-limiting

In

ACM

SIGPLAN

Conf

on

Programming

Language

Design

and

Implementation

pages

-LCB-

Orlando

June

-LSB-

-RSB-

P.

Feautrier

Dataflow

analysis

of

scalar

and

array

references

Int

Journal

of

Parallel

Programming

-LRB-

-RRB-

-LCB-

February

-LSB-

-RSB-

D.

E.

Maydan

S.

P.

Amarasinghe

and

M.

S.

Lam

Array

dataflow

analysis

and

its

use

in

array

privatization

In

ACM

Symp

on

Principles

of

Programming

Languages

pages

-LCB-

January

-LSB-

-RSB-

W.

Pugh

A

practical

algorithm

for

exact

array

dependence

analysis

Communications

of

the

ACM

-LRB-

-RRB-

-LCB-

August

-LSB-

-RSB-

J.-F

Collard

D.

Barthou

and

P.

Feautrier

Fuzzy

array

dataflow

analysis

In

Proc

of

ACM

SIGPLAN

Symp

on

Principles

and

Practice

of

Parallel

Programming

pages

-LCB-

Santa

Barbara

CA

July

-LSB-

-RSB-

William

Pugh

and

David

Wonnacott

Nonlinear

array

dependence

analysis

In

Third

Workshop

on

Languages

Compilers

and

Run-Time

Systems

for

Scalable

Computers

Troy

New

York

May

-LSB-

-RSB-

D.

Wonnacott

Constraint-Based

Array

Dependence

Analysis

PhD

thesis

U.

of

Maryland

-LSB-

-RSB-

A.

Cohen

J.-F

Collard

and

M.

Griebl

Data-flow

analysis

of

recursive

structures

submitted

to

PLDI

-LSB-

-RSB-

J.

E.

Hopcroft

and

J.

D.

Ullman

Introduction

to

Automata

Theory

Languages

and

Computation

Addison-Wesley

-LSB-

-RSB-

H.

T.

Lewis

and

C.

H.

Papadimitriou

Elements

of

the

Theory

of

Computation

Prentice

Hall

O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O


ANGEWANDTE

MATHEMATIK

UND

INFORMATIK

UNIVERSIT?AT

ZU

K?OLN

Report

No.

On

the

Two-Connected

Planar

Spanning

Subgraph

Polytope

by

C.

De

Simone

and

M.

J?unger

Research

supported

in

part

by

DFG-Grant

Effiziente

Algorithmen

f?ur

diskrete

Probleme

und

ihre

Anwendungen

Institut

f?ur

Informatik

UNIVERSIT?AT

ZU

K?OLN

Pohligstrasse

K?oln

Addresses

of

the

authors

Caterina

De

Simone

Istituto

di

Analisi

dei

Sistemi

ed

Informatica

del

CNR

Viale

Manzoni

Roma

Italy

Email

desimone@iasi.rm.cnr.it

Michael

J?unger

Institut

f?ur

Informatik

Universit?at

zu

K?oln

Pohligstrasse

K?oln

Germany

Email

mjuenger@informatik.uni-koeln.de

On

the

Two-Connected

Planar

Spanning

Subgraph

Polytope

Caterina

De

Simoney

Michael

J?ungerz

Abstract

The

problem

of

finding

in

a

complete

edge-weighted

graph

a

two-connected

planar

spanning

subgraph

of

maximum

weight

is

important

in

automatic

graph

drawing

We

investigate

the

problem

from

a

polyhedral

point

of

view

Introduction

We

assume

familiarity

with

basic

notions

of

graph

theory

-LRB-

see

for

instance

-LSB-

-RSB-

-RRB-

and

with

elementary

notions

of

polyhedral

combinatorics

-LRB-

see

for

instance

-LSB-

-RSB-

-RRB-

Our

graphs

will

be

undirected

and

simple

-LRB-

no

loops

and

no

multiple

edges

-RRB-

As

usual

Kn

denotes

the

complete

graph

with

n

vertices

Kn

m

denotes

the

complete

bipartite

graph

with

n

m

vertices

and

n

m

edges

Let

G

be

a

graph

G

is

connected

if

for

every

pair

of

distinct

vertices

there

exists

a

path

in

G

joining

them

G

is

twoconnected

if

for

every

vertex

v

of

G

the

graph

G

v

is

connected

G

is

planar

if

it

can

be

embedded

in

the

plane

A

subgraph

H

of

a

G

is

spanning

if

the

vertex

sets

of

H

and

G

are

the

same

Subdivision

of

an

edge

uv

of

G

consists

of

removing

edge

uv

and

adding

a

new

vertex

w

and

the

two

edges

uw

and

vw

w

is

called

subdivision

vertex

If

G

and

H

are

two

graphs

we

say

that

G

contains

a

subdivision

of

H

if

H

arises

by

subdivision

of

the

edges

of

some

subgraph

of

G

As

usual

ffi

-LRB-

u

-RRB-

denotes

the

set

of

all

edges

that

are

incident

in

the

vertex

u

In

automatic

graph

drawing

the

following

problem

arises

find

in

a

complete

graph

with

weights

on

its

edges

a

two-connected

planar

spanning

subgraph

with

weight

as

Partially

supported

by

DFG-Grant

Forschungsschwerpunkt

Effiziente

Algorithmen

f?ur

diskrete

Probleme

und

ihre

Anwendungen

yIASI-CNR

Viale

Manzoni

Rome

Italy

zInstitut

f?ur

Informatik

Universit?at

zu

K?oln

Pohligstrasse

K?oln

large

as

possible

This

problem

is

NP-hard

and

it

was

introduced

in

-LSB-

-RSB-

In

this

paper

we

shall

study

this

problem

from

a

polyhedral

point

of

view

For

this

purpose

let

n

be

an

integer

greater

than

or

equal

to

four

Let

S

-LRB-

Kn

-RRB-

denote

the

set

of

the

incidence

vectors

of

all

spanning

subgraphs

of

Kn

that

are

both

planar

and

two-connected

and

let

P

-LRB-

Kn

-RRB-

denote

the

convex

hull

of

S

-LRB-

Kn

-RRB-

P

-LRB-

Kn

-RRB-

is

known

as

the

two-connected

planar

subgraph

polytope

In

-LSB-

-RSB-

a

first

version

of

a

branch

and

cut

algorithm

based

on

the

partial

knowledge

of

the

facet-defining

structure

of

P

-LRB-

Kn

-RRB-

found

in

-LSB-

-RSB-

-LSB-

-RSB-

and

-LSB-

-RSB-

was

designed

and

tested

The

partial

knowledge

of

P

-LRB-

Kn

-RRB-

comes

from

the

investigations

of

two

other

related

polytopes

namely

the

convex

hull

-LRB-

Kn

-RRB-

of

the

incidence

vectors

of

all

subgraphs

of

Kn

that

are

planar

-LSB-

-RSB-

and

the

convex

hull

-LRB-

Kn

-RRB-

of

the

incidence

vectors

of

all

spanning

subgraphs

of

Kn

that

are

two-connected

-LSB-

-RSB-

Indeed

P

-LRB-

Kn

-RRB-

-LRB-

Kn

-RRB-

-LRB-

Kn

-RRB-

and

so

every

inequality

valid

for

Qi

-LRB-

Kn

-RRB-

-LRB-

i

-RRB-

is

also

valid

for

P

-LRB-

Kn

-RRB-

In

-LSB-

-RSB-

it

was

shown

that

every

facet-defining

inequality

of

-LRB-

Kn

-RRB-

is

also

facet-defining

for

P

-LRB-

Kn

-RRB-

and

that

some

facet-defining

inequalities

of

-LRB-

Kn

-RRB-

are

also

facet-defining

for

P

-LRB-

Kn

-RRB-

It

is

not

known

whether

every

facet-defining

inequality

for

-LRB-

Kn

-RRB-

is

also

facet-defining

for

P

-LRB-

Kn

-RRB-

The

purpose

of

this

paper

is

to

investigate

the

structure

of

P

-LRB-

Kn

-RRB-

that

does

not

arise

from

the

structures

of

-LRB-

Kn

-RRB-

and

-LRB-

Kn

-RRB-

Clearly

not

every

facet-defining

inequality

for

P

-LRB-

Kn

-RRB-

is

necessarily

facet-defining

for

-LRB-

Kn

-RRB-

or

for

-LRB-

Kn

-RRB-

In

fact

we

shall

show

that

there

exist

facet-defining

inequalities

for

P

-LRB-

Kn

-RRB-

that

are

valid

for

neither

-LRB-

Kn

-RRB-

nor

for

-LRB-

Kn

-RRB-

Facets

arising

from

subdivisions

of

and

The

two

graphs

and

play

a

central

role

in

planarity

Kuratowski

-LSB-

-RSB-

showed

that

a

graph

is

planar

if

and

only

if

it

contains

no

subdivisions

of

or

Subdivisions

of

and

of

will

play

a

central

role

also

in

this

paper

Consider

the

complete

graph

with

vertices

Subdivide

each

edge

ij

of

-LRB-

i

j

-RRB-

Nij

times

with

Nij

let

ijNij

denote

the

corresponding

subdivision

vertices

Denote

by

G

-LRB-

V

E

-RRB-

the

resulting

graph

Note

that

for

every

i

j

the

graph

G

contains

the

edges

-LRB-

i

-RRB-

-LRB-

-RRB-

-LRB-

ijNij

ijNij

-RRB-

and

-LRB-

ijNij

j

-RRB-

and

it

does

not

contain

the

edge

-LRB-

i

j

-RRB-

We

shall

refer

to

each

of

the

five

vertices

of

G

as

a

white

vertex

and

to

each

of

all

others

-LRB-

vertex

ijk

-RRB-

as

a

black

vertex

Let

N

denote

the

total

number

of

black

vertices

of

G.

Note

that

by

assumption

N

Figure

shows

a

graph

G

with

black

vertices

For

every

i

j

let

K

-LRB-

i

j

-RRB-

denote

the

complete

graph

with

vertex

set

fi

ijNij

jg

and

let

G

-LRB-

V

E

-RRB-

be

the

graph

obtained

from

G

by

adding

every

edge

of

each

K

-LRB-

i

j

-RRB-

Write

n

N

and

let

Kn

denote

the

complete

graph

with

vertex

set

V

Let

F

denote

the

set

of

all

edges

of

Kn

that

are

not

edges

of

G

Figure

A

subdivision

of

The

following

theorem

shows

that

the

inequality

x

-LRB-

F

-RRB-

defines

a

facet

of

P

-LRB-

Kn

-RRB-

Note

that

such

an

inequality

is

not

valid

for

-LRB-

Kn

-RRB-

-LRB-

because

for

every

edge

e

of

G

the

graph

G

e

is

planar

and

its

incidence

vector

y

is

such

that

y

-LRB-

F

-RRB-

-RRB-

and

is

not

valid

for

-LRB-

Kn

-RRB-

-LRB-

because

the

graph

G

is

two-connected

and

its

incidence

vector

y

is

such

that

y

-LRB-

F

-RRB-

-RRB-

Theorem

For

every

complete

graph

Kn

with

n

the

inequality

x

-LRB-

F

-RRB-

defines

a

facet

of

P

-LRB-

Kn

-RRB-

Proof

To

prove

the

validity

let

y

be

the

an

arbitrary

point

in

S

-LRB-

Kn

-RRB-

and

let

H

be

the

subgraph

of

Kn

corresponding

to

y

We

only

need

show

that

y

-LRB-

F

-RRB-

For

this

purpose

assume

that

y

-LRB-

F

-RRB-

and

so

y

-LRB-

F

-RRB-

But

then

every

edge

of

H

must

be

an

edge

of

the

graph

G

which

is

impossible

G

is

not

planar

and

no

spanning

planar

subgraph

of

G

is

two-connected

Since

y

was

an

arbitrary

point

in

S

-LRB-

Kn

-RRB-

it

follows

that

the

inequality

is

valid

over

P

-LRB-

Kn

-RRB-

Now

let

c

-LRB-

-RRB-

such

that

ce

for

every

edge

e

of

G

and

ce

for

every

other

edge

in

other

words

ce

if

and

only

if

e

F

and

so

the

inequality

x

-LRB-

F

-RRB-

reads

cTx

Let

xt

be

points

in

S

-LRB-

Kn

-RRB-

such

that

cT

xi

for

all

i

t

and

let

c

be

a

vector

such

that

cxi

cxj

for

all

choices

of

i

and

j.

Clearly

to

show

that

cT

x

defines

a

facet

of

P

-LRB-

Kn

-RRB-

we

only

need

show

that

c

is

a

multiple

of

c.

For

this

purpose

set

T

xtg

First

we

shall

show

that

ce

for

every

edge

e

of

G

Let

e

be

an

arbitrary

such

an

edge

Without

loss

of

generality

we

can

assume

that

e

is

an

edge

of

the

complete

graph

K

-LRB-

-RRB-

Let

u

and

v

denote

the

vertices

and

respectively

Consider

the

subgraph

H

of

Kn

obtained

from

G

by

deleting

edge

-LRB-

u

-RRB-

and

by

adding

edge

-LRB-

u

v

-RRB-

-LRB-

see

Figure

-RRB-

and

let

y

denote

its

incidence

vector

Clearly

y

T

Figure

The

graph

H

Now

if

e

E

-LRB-

i.e.

e

is

an

edge

of

K

-LRB-

-RRB-

and

is

not

an

edge

of

G

-RRB-

then

we

let

denote

the

subgraph

of

Kn

obtained

from

H

by

adding

the

edge

e

Since

the

incidence

vector

of

belongs

also

to

T

by

assumption

cy

and

so

ce

and

we

are

done

Hence

assume

that

e

E

If

one

endpoint

of

e

is

a

white

vertex

then

without

loss

of

generality

we

can

assume

that

e

-LRB-

v

-RRB-

-LRB-

in

case

e

-LRB-

-RRB-

it

is

sufficient

to

set

v

-RRB-

In

this

case

we

let

denote

the

subgraph

of

Kn

obtained

from

H

by

deleting

edge

e

Since

the

incidence

vector

of

belongs

also

to

T

by

assumption

cy

and

so

ce

and

again

we

are

done

Otherwise

both

endpoints

of

the

edge

e

in

E

are

black

and

so

e

-LRB-

-RRB-

with

k

Let

H

denote

the

subgraph

of

Kn

obtained

from

H

by

deleting

edge

-LRB-

u

v

-RRB-

and

adding

edge

-LRB-

u

-RRB-

and

let

denote

its

incidence

vector

-LRB-

Note

that

if

k

then

y

and

so

H

and

H

are

in

fact

the

same

graph

-RRB-

Clearly

T

Now

let

be

the

subgraph

of

Kn

obtained

from

H

by

deleting

edge

e

and

by

adding

edge

f

-LRB-

-RRB-

Since

the

incidence

vector

of

belongs

also

to

T

by

assumption

and

so

ce

cf

But

cf

-LRB-

since

f

is

an

edge

of

K

-LRB-

-RRB-

and

is

not

an

edge

of

G

-RRB-

and

so

ce

and

again

we

are

done

Hence

we

have

shown

that

ce

for

every

edge

e

of

G

Now

to

finish

the

proof

we

only

need

show

that

ce

has

the

same

value

for

every

e

F

For

this

purpose

let

u

ijk

be

an

arbitrary

black

vertex

of

Kn

without

loss

of

generality

we

can

assume

that

u

with

k

We

propose

to

show

that

ce

cf

for

every

pair

of

arbitrary

edges

e

f

in

F

ffi

-LRB-

u

-RRB-

Note

that

as

soon

as

this

is

accomplished

we

are

done

since

every

edge

in

F

has

a

black

endpoint

and

since

u

was

chosen

arbitrary

among

all

black

vertices

Consider

the

graph

HL

in

Figure

and

the

graph

HR

in

Figure

where

all

black

vertices

with

i

are

present

Figure

The

graph

HL

Let

L

denote

the

subset

of

V

of

all

vertices

that

do

not

belong

to

the

complete

graphs

K

-LRB-

-RRB-

K

-LRB-

-RRB-

K

-LRB-

-RRB-

and

K

-LRB-

-RRB-

and

let

R

denote

the

subset

of

V

of

all

vertices

that

do

not

belong

to

the

complete

graphs

K

-LRB-

-RRB-

K

-LRB-

-RRB-

K

-LRB-

-RRB-

and

K

-LRB-

-RRB-

Write

e

-LRB-

u

v

-RRB-

and

f

-LRB-

u

w

-RRB-

clearly

both

v

and

w

are

in

L

-LSB-

R

If

both

vertices

v

and

w

are

in

L

-LRB-

or

in

R

-RRB-

consider

the

graphs

and

obtained

from

HL

-LRB-

or

HR

-RRB-

by

adding

edge

e

and

edge

f

respectively

let

and

denote

the

corresponding

incidence

vectors

Since

both

and

are

in

T

by

assumption

and

so

ce

cf

But

then

since

R

L

and

since

cg

for

every

g

F

it

follows

that

ce

cf

for

every

choice

of

e

and

f

in

F

ffi

-LRB-

u

-RRB-

The

theorem

follows

A

different

class

of

facet-defining

inequalities

for

the

polytope

P

-LRB-

Kn

-RRB-

can

be

obtained

in

a

similar

way

from

the

complete

bipartite

graph

Let

denote

the

vertices

of

and

let

Q

denote

its

edge-set

i.e.

Q

Subdivide

each

edge

ij

of

Nij

times

with

Nij

and

let

ijNij

denote

the

corresponding

subdivision

vertices

Denote

by

G

-LRB-

V

E

-RRB-

the

Figure

The

graph

HR

resulting

graph

Note

that

G

contains

all

the

edges

-LRB-

i

-RRB-

-LRB-

-RRB-

-LRB-

ijNij

ijNij

-RRB-

and

-LRB-

ijNij

j

-RRB-

and

it

does

not

contain

the

edge

-LRB-

i

j

-RRB-

for

every

ij

Q.

Figure

shows

a

graph

G

having

subdivision

vertices

Note

that

by

assumption

the

total

number

of

subdivision

vertices

is

at

least

nine

Set

M

and

let

G

-LRB-

V

E

-RRB-

be

the

graph

obtained

from

G

by

adding

all

edges

in

M

and

by

adding

every

edge

of

each

K

-LRB-

i

j

-RRB-

for

all

ij

Q

where

K

-LRB-

i

j

-RRB-

denote

the

complete

graph

with

vertex

set

fi

ijNij

jg

Let

Kn

denote

the

complete

graph

with

vertex

set

V

and

let

F

denote

the

set

of

all

edges

of

Kn

that

are

not

edges

of

G

The

following

theorem

shows

that

the

inequality

x

-LRB-

F

-RRB-

defines

a

facet

of

P

-LRB-

Kn

-RRB-

Note

that

also

this

inequality

is

not

valid

for

-LRB-

Kn

-RRB-

-LRB-

because

for

every

edge

e

of

G

the

graph

G

e

is

planar

and

its

incidence

vector

y

is

such

that

y

-LRB-

F

-RRB-

-RRB-

and

is

not

valid

for

-LRB-

Kn

-RRB-

-LRB-

because

the

graph

G

is

two-connected

and

its

incidence

vector

y

is

such

that

y

-LRB-

F

-RRB-

-RRB-

Theorem

For

every

complete

graph

Kn

with

n

the

inequality

x

-LRB-

F

-RRB-

defines

a

facet

of

P

-LRB-

Kn

-RRB-

Proof

The

proof

is

similar

to

the

proof

of

Theorem

The

only

difference

is

that

we

have

to

show

that

ce

also

for

every

edge

e

M

and

this

is

easy

Acknowledgements

We

would

like

to

thank

Petra

Mutzel

and

Mechthild

Stoer

for

helpful

discussions

on

this

topic

References

-LSB-

-RSB-

C.

Berge

Graphs

and

Hypergraphs

-LRB-

North-Holland

Amsterdam

-RRB-

-LSB-

-RSB-

M.R.

Garey

and

D.S.

Johnson

Computer

and

Intractability

a

Guide

to

the

Theory

of

NP-Completeness

-LRB-

Freeman

New

York

-RRB-

-LSB-

-RSB-

K.

Kuratowski

Sur

le

probl?eme

de

courbes

gauches

en

topologie

Fund

Math

-LRB-

-RRB-

-LCB-

-LSB-

-RSB-

P.

Mutzel

The

Maximum

Planar

Subgraph

Problem

Ph.D.

Dissertation

Universit?at

zu

K?oln

-LRB-

-RRB-

-LSB-

-RSB-

P.

Mutzel

A

Polyhedral

Approach

to

Planar

Augmentation

and

Related

Problems

in

Algorithms

-LCB-

ESA

Lecture

Notes

in

Comp

Scie

-LRB-

P.

Spirakis

ed.

-RRB-

-LCB-

-LSB-

-RSB-

A.

Schrijver

Theory

of

Linear

and

Integer

Programming

-LRB-

Wiley

Chichester

-RRB-

-LSB-

-RSB-

M.

Stoer

Design

of

Survivable

Networks

Lectures

Notes

in

Math

-LRB-

SpringerVerlags

Berlin

-RRB-

O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O

planar graphs
polyhedra
two-connected graphs