34/1 © 2012 prof. dr. franz j. brandenburg stacks, queues,deques and their representations as...

41
34/1 © 2012 Prof. Dr. Franz J. Brandenburg Stacks, Queues,Deques and their Representations as Drawings Franz J. Brandenburg University of Passau joint work with Christopher Auer and Andreas Gleißner

Upload: erika-tamsyn-hart

Post on 25-Dec-2015

223 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: 34/1 © 2012 Prof. Dr. Franz J. Brandenburg Stacks, Queues,Deques and their Representations as Drawings Franz J. Brandenburg University of Passau joint

34/1

© 2012 Prof. Dr. Franz J. Brandenburg

Stacks, Queues,Deques

and their Representations as Drawings

Franz J. Brandenburg

University of Passau

joint work with

Christopher Auer and Andreas Gleißner

Page 2: 34/1 © 2012 Prof. Dr. Franz J. Brandenburg Stacks, Queues,Deques and their Representations as Drawings Franz J. Brandenburg University of Passau joint

34/2

© 2012 Prof. Dr. Franz J. Brandenburg

Basics

Data Structures are used to store data

by operations which get (read), insert and remove items.

What makes the difference between different data structures? Stack vs queue?

Insertion: anytime, no difference

Removal: When can an item be accessed.

Together: An axiomatic description of the behavior.

Example

Stack: insert (push) and remove (pop) and get (top)

main axiom: s = s.insert(x); s.remove();

The stack is unchanged after insert, remove.

x = s.get(); s.remove(), s.insert(x)

may cause an error if s is empty.

Array: random access

main axiom: NONE, its unpredicable, its chaos

Page 3: 34/1 © 2012 Prof. Dr. Franz J. Brandenburg Stacks, Queues,Deques and their Representations as Drawings Franz J. Brandenburg University of Passau joint

34/3

© 2012 Prof. Dr. Franz J. Brandenburg

Stack and Queue

stack (LIFO)

a linked list with insert and remove to the left (or top)

queue (FIFO)

a linked list with a head (right) for insert

and a tail (left) for get and remove

Axioms: NONE, it is too complex

1

23

4

.....insert/push

remove/pop1234

headtail

.....4 3 2 1

Page 4: 34/1 © 2012 Prof. Dr. Franz J. Brandenburg Stacks, Queues,Deques and their Representations as Drawings Franz J. Brandenburg University of Passau joint

34/4

© 2012 Prof. Dr. Franz J. Brandenburg

Ucommuting pipes

Deques

deque (double-ended queue)

implemented by the class Arraydeque in Java 6

seen as a doubly linked list with a head (right) and a tail (left)

and insert and remove at either ends.

headtail

..... 43 1 625

5

1 246

headtail

3

Page 5: 34/1 © 2012 Prof. Dr. Franz J. Brandenburg Stacks, Queues,Deques and their Representations as Drawings Franz J. Brandenburg University of Passau joint

34/5

© 2012 Prof. Dr. Franz J. Brandenburg

History

• Who invented stacks and queues?

• use of stacks in programming languages

for the formal description of ALGOL (1960)

by F.L. Bauer (TU Munich)

… the axioms for a stack

• use as data structures

by D.E. Knuth (Stanford) in The Art of Computer Programming (1968)

… stack, queue, deque, input/output restricted deque

deque = double ended queue

This name is misleading.

The queue mode is secondary! But ... (see later)

Page 6: 34/1 © 2012 Prof. Dr. Franz J. Brandenburg Stacks, Queues,Deques and their Representations as Drawings Franz J. Brandenburg University of Passau joint

34/6

© 2012 Prof. Dr. Franz J. Brandenburg

Deques

a deque has a stack mode at either end

has a queue mode from left to right (or right to left)

a deque can simulate 2 stacks

a deque can simulate 1 queue

What happens in queue mode?

How strong is a deque?

a deque can be simulated by 2 stacks + 1 queue

Can a deque simulate 2 stacks + 1 queue

headtail

..... 43 1 6250

Press all items out (6,4,2,1,3,5)

Page 7: 34/1 © 2012 Prof. Dr. Franz J. Brandenburg Stacks, Queues,Deques and their Representations as Drawings Franz J. Brandenburg University of Passau joint

34/7

© 2012 Prof. Dr. Franz J. Brandenburg

Stack

What is typical? What is characteristic?

• algorithm depth first search• structure LIFO last in, first out• pattern nested parenthesis ((( )) ()), [ ( ) ]• programming paradigm recursion• storage behavior destroy information

you cannot save the item you remove• area of influence local

the closing parenthesis bounds the inner substructure

• graphs nested rainbows

( ( ( ( ) ) ) ( ( ) ) )

Page 8: 34/1 © 2012 Prof. Dr. Franz J. Brandenburg Stacks, Queues,Deques and their Representations as Drawings Franz J. Brandenburg University of Passau joint

34/8

© 2012 Prof. Dr. Franz J. Brandenburg

Queue

What is typical? What is characteristic?

• algorithm breadth first search

• structure FIFO first in, first out

• pattern twist ( ( ( ) ) ( ) ), [ ( ] )

equality set (x) = ‘(x) with projections ‘

• programming paradigm streams, buffers

• storage behavior copy information

reinsert the removed item

• area of influence global

• graphs twists with very many crossings

Page 9: 34/1 © 2012 Prof. Dr. Franz J. Brandenburg Stacks, Queues,Deques and their Representations as Drawings Franz J. Brandenburg University of Passau joint

34/9

© 2012 Prof. Dr. Franz J. Brandenburg

Linear Layouts of Graphs

Definition

a linear layout of a graph G = (V,E)

place the vertices on a line or number the vertices 1,2,....,n

for every pair of edges (u, v) and (x, y)

nesting if u < x < y < v e.g. (1,4) (2,3)

twist or cross if u < x < v < y e.g. (1,3), (2,4)

A linear layout is

a stack layout if no two edges twist or cross

a queue layout if no two edges nest

This is the complementary view: define by exclusion.

Page 10: 34/1 © 2012 Prof. Dr. Franz J. Brandenburg Stacks, Queues,Deques and their Representations as Drawings Franz J. Brandenburg University of Passau joint

34/10

© 2012 Prof. Dr. Franz J. Brandenburg

Book Embeddings

Definition (Bernhard, Kainen, 1979)

A book-embedding of a (undirected) graph G = (V,E) is

– a linear ordering of the vertices 1,2,...n

on the spine of the book

– a planar drawing of the edges (u,v) on the pages

as nested arches (LIFO)

Add some more edges, (2,8) and (2,11), (2,12) but (5,9) were illegal

1 2 3 4 5 6 7 8 9 10 11 12

Page 11: 34/1 © 2012 Prof. Dr. Franz J. Brandenburg Stacks, Queues,Deques and their Representations as Drawings Franz J. Brandenburg University of Passau joint

34/11

© 2012 Prof. Dr. Franz J. Brandenburg

Book Embeddings

Theorem (Bernhard, Kainen, 1979)

A graph G has a book embedding (with 1 page)

if and only if

G is a subgraph of an outerplanar graph

if and only if

G is a stack graph

visit the vertices from left to right and push/pop the edges

At 1: push (1,12), push (1,2)

At 2: pop (1,2), push (2,12), (2,11), (2,8), (2,7)

1 2 3 4 5 6 7 8 9 10 11 12

(2,7)(2,8)(2,11)(2,12)(1,12)

top

Page 12: 34/1 © 2012 Prof. Dr. Franz J. Brandenburg Stacks, Queues,Deques and their Representations as Drawings Franz J. Brandenburg University of Passau joint

34/12

© 2012 Prof. Dr. Franz J. Brandenburg

Graph and Data Structures

Definiton

Let DS be a structure with insert and remove operations

e.g., stack, queue, deque,

2-stacks, 1-stack + 1-queue, ....

with insert/remove at the head/tail (1st, 2nd stack....)

A graph G = (V,E) is a DS graph (e.g. stack/queue/deque/2-stack/...)

if there is a linear order of the vertices, say 1,2,....,n

such that the edges at vertex v can be correctly processed by DS

(u,v) is removed from DS if u < v

(v,w) is inserted into DS if v < w.

The local order at a vertex is chosen appropriately.

For the correctness:

an edge (u,v) must be directly accessible if it is removed at v.

The order of the edges must meet the data structure.

Page 13: 34/1 © 2012 Prof. Dr. Franz J. Brandenburg Stacks, Queues,Deques and their Representations as Drawings Franz J. Brandenburg University of Passau joint

34/13

© 2012 Prof. Dr. Franz J. Brandenburg

Example: K4

Process on the stack in the order 1,2,3,4

1: push (1,4), (1,3), (1,2)

2: pop (1,2)

push (2,4), (2,3)

3: pop (2,3), pop(1,3)

Process on a queue in the order 1,2,3,4

1: insert (1,2), (1,3), 1,4)

2: remove (1,2)

insert (2,3), (2,4)

3: remove (1,3), (2,3)

1 2

3

4

(2,4)(1,3)(1,4)

top

(1,4) (1,3) (1,2)

tail (insert) head (remove)

(2,4) (2,3) (1,4) (1,3)

(2,4) (2,3) (1,4)

Page 14: 34/1 © 2012 Prof. Dr. Franz J. Brandenburg Stacks, Queues,Deques and their Representations as Drawings Franz J. Brandenburg University of Passau joint

34/14

© 2012 Prof. Dr. Franz J. Brandenburg

K4 and Deque

Process the vertices 1,2,3,4

1: insert-left (1,2), insert-right (1,4), (1,3)

2: remove-left (1,2)

insert-left (2,4), (2,3)

3: remove-right (1,3), remove-left (2,3)

insert-left (3,4)

4: remove-right (1,4), (2,4), (3,4),

1 2

3

4

(1,4)(1,2) (1,3)(2,4)(2,3)

Page 15: 34/1 © 2012 Prof. Dr. Franz J. Brandenburg Stacks, Queues,Deques and their Representations as Drawings Franz J. Brandenburg University of Passau joint

34/15

© 2012 Prof. Dr. Franz J. Brandenburg

Stack Graphs

Theorem (Bernhard, Kainen (1979))

1-stack = outerplanar (subgraph of)

Test: in O(n)

2-stack = subgraph of a planar graph with a Hamilton cycle

Test: NP-complete

Theorem (Yannakakis (1989))

Every planar graph is a 4-stack graph

Claim: some planar graphs need 4 stacks.

stack-number = min # stacks

Test: NP-hard.

Page 16: 34/1 © 2012 Prof. Dr. Franz J. Brandenburg Stacks, Queues,Deques and their Representations as Drawings Franz J. Brandenburg University of Passau joint

34/16

© 2012 Prof. Dr. Franz J. Brandenburg

Queue Graphs

Theorem (Heath, Rosenberg (1992))

1-queue = arch leveled planar

Test: NP-hard

Definition

A graph G = (V,E) is arch leveled planar if

there is a leveling of the vertices

- proper level edges

- arches from the leftmost vertex

to the „open“ right vertices

on the same level

and planar

Page 17: 34/1 © 2012 Prof. Dr. Franz J. Brandenburg Stacks, Queues,Deques and their Representations as Drawings Franz J. Brandenburg University of Passau joint

34/17

© 2012 Prof. Dr. Franz J. Brandenburg

Simulations

Theorem (Heath, Leighton, Rosenberg (1993))

Every 1-queue graph is a 2-stack graph

namely: a planar sub-Hamiltonian graph

Every 1-stack graph is a 2-queue graph

namely: outerplanar

1-queue < 2-stack

and 1-stack < 2-queue

Hence stack-thickness < 2 queue-thickness

queue-thickness < 2 stack-thickness

But this does not scale to stack-number and queue-number

since you must choose one linear odering of the vertices

OPEN

stack-number vs queue-number

Page 18: 34/1 © 2012 Prof. Dr. Franz J. Brandenburg Stacks, Queues,Deques and their Representations as Drawings Franz J. Brandenburg University of Passau joint

34/18

© 2012 Prof. Dr. Franz J. Brandenburg

Linear Cylindric Drawing

Definition (Auer, Brandenburg, et al GD2010)

A linear cylindric drawing is a planar drawing

on a rolling cylinder

with the vertices in a linear ordering on the front line

with edges on the front or winding over the backside

Page 19: 34/1 © 2012 Prof. Dr. Franz J. Brandenburg Stacks, Queues,Deques and their Representations as Drawings Franz J. Brandenburg University of Passau joint

34/19

© 2012 Prof. Dr. Franz J. Brandenburg

2D-drawing

cut along the front line

split or copy the vertices on the front line and unfold

Page 20: 34/1 © 2012 Prof. Dr. Franz J. Brandenburg Stacks, Queues,Deques and their Representations as Drawings Franz J. Brandenburg University of Passau joint

34/20

© 2012 Prof. Dr. Franz J. Brandenburg

Linear Cylindric Drawings

• take two horizontal levels

or the upper and lower borders of a square

• take identical copies of the order of the vertices

• draw „stack“ edges / rainbows below the upper level

• draw „stack“ edge / rainbows above the lower level

• draw „queue“ edges between the levels

• PLANAR

Page 21: 34/1 © 2012 Prof. Dr. Franz J. Brandenburg Stacks, Queues,Deques and their Representations as Drawings Franz J. Brandenburg University of Passau joint

34/21

© 2012 Prof. Dr. Franz J. Brandenburg

Deque Graphs

THEOREM 1 (Auer, Bachmaier, Brandenburg, Brunner, Gleißner, GD2010)

A graph G is a deque graph

if and only if

G has a linear cylindric drawing

Proof:

Take the order of the vertices, 1,2,...,n

Classify the edges:

lower stack iff insert and remove at the head

upper stack iff insert and remove at the tail

queue from bottom left to top right iff insert at head and remove at tail

queue from top left to bottom right iff insert at tail and remove from head

Page 22: 34/1 © 2012 Prof. Dr. Franz J. Brandenburg Stacks, Queues,Deques and their Representations as Drawings Franz J. Brandenburg University of Passau joint

34/22

© 2012 Prof. Dr. Franz J. Brandenburg

Queue Graphs

Corollary

A graph G is a queue graph

if and only if

G is arch leveled planar (Heath, Rosenberg 1992)

if and only if

G is linear cylindric with only queue arcs

with only straight lines from NW to SE

between the two sides

Page 23: 34/1 © 2012 Prof. Dr. Franz J. Brandenburg Stacks, Queues,Deques and their Representations as Drawings Franz J. Brandenburg University of Passau joint

34/23

© 2012 Prof. Dr. Franz J. Brandenburg

2-Stack vs Deque

Theorem

G is a 2-stack graph (Bernhard, Kainen (1979))

iff G is a subgraph of a planar graph with a Hamilton cycle

G is a deque graph

iff G is a subgraph of a planar graph with a Hamilton path

... and there are planar graphs

which have no Hamilton path

which have a Hamilton path and not a Hamilton cycle

Di Giacomo et al Comput Geom 30 (2005),

Page 24: 34/1 © 2012 Prof. Dr. Franz J. Brandenburg Stacks, Queues,Deques and their Representations as Drawings Franz J. Brandenburg University of Passau joint

34/24

© 2012 Prof. Dr. Franz J. Brandenburg

Deque & Hamilton Path

Proof: Take the linear order. Add edges for a Hamilton path. Draw the stack edges Draw the queue edges as arches over the north pole (right)

Page 25: 34/1 © 2012 Prof. Dr. Franz J. Brandenburg Stacks, Queues,Deques and their Representations as Drawings Franz J. Brandenburg University of Passau joint

34/25

© 2012 Prof. Dr. Franz J. Brandenburg

Computability

Computability is defined via Turing machines with a finite state control

a read-only input tape

and (one or more) read-write working tapes.

pushdown automaton = Turing machine with 1 stack

... the working tape is/operates like a stack and nondeterminism.

... these are the context-free languages with an O(n3) membership test

queue machine = Turing machine with 1 queue (Post (1936), Brandenburg (1982))

... the working tapes are queues with two heads (head, tail)

Page 26: 34/1 © 2012 Prof. Dr. Franz J. Brandenburg Stacks, Queues,Deques and their Representations as Drawings Franz J. Brandenburg University of Passau joint

34/26

© 2012 Prof. Dr. Franz J. Brandenburg

Universality

Universal Machines

• Turing machines (with one or more Turing tapes)

• machines with 2-pushdown stacks with O(1) slowdown per operation

with O(n) to simulate a queue

• machines with 1 queue with (n2) slowdown

The Power of a Queue

the Post Correspondence Problem

Given: a finite set of pairs of strings (xi, yi)

Problem: Is there a correspondence?

xi1 xi2 ...xiq = yi1 yi2 ...yiq

Solution: Use a queue to buffer the difference between

xi1 xi2 ... xij and yi1 yi2 ...yij

Page 27: 34/1 © 2012 Prof. Dr. Franz J. Brandenburg Stacks, Queues,Deques and their Representations as Drawings Franz J. Brandenburg University of Passau joint

34/27

© 2012 Prof. Dr. Franz J. Brandenburg

PCP

Example 1:

1. 1 10 011

2. 101 00 11

Solution: 1 3 2 3 = 1 011 10 011 = 101 11 00 11

Example 2:

1: 011 01 01 10

2: 0 011 101 011

Solution (with 66 entries)

24344 21243 43443 44214 42134 11344 42121 11343 41214 42141 13411 31131 21411 3

Page 28: 34/1 © 2012 Prof. Dr. Franz J. Brandenburg Stacks, Queues,Deques and their Representations as Drawings Franz J. Brandenburg University of Passau joint

34/28

© 2012 Prof. Dr. Franz J. Brandenburg

Typical Languages

Formal Language Theory

abstract families of languages, AFL (here trios)

generators of language families

initiators: N. Chomsky, G. Schützenberger

investigators: S.A. Greibach, S. Ginsburg, J. Berstel .. in the 60-80th

Which languages characterizes the context-free languages?

the Dyck set of well nested parenthesis ( ) and brackets [ ]

generated by the rules S SS, S ( S ), S [ S ], S [ [ ( ) ( ) ] ( ) ( ) ]

generator: use homomorphisms g and h-1 over alphabets/strings *

and intersection with regular sets R

such that CFL = g(h-1(Dyck) R)

known as the Chomsky-Schützenberger Theorem

Page 29: 34/1 © 2012 Prof. Dr. Franz J. Brandenburg Stacks, Queues,Deques and their Representations as Drawings Franz J. Brandenburg University of Passau joint

34/29

© 2012 Prof. Dr. Franz J. Brandenburg

Queue Languages

equality sets of two homomorphisms g, h

Eg(g,h) = {w * | g(w) = h(w)}

Example:

let = (, ), [, ]

let g preserve ( and ] and g erases ) ]

let h preserve and rename ( ) and ] [

Then Eg(g,h) = all FIFO nested strings of parenthesis and brackets

( [ [ ) ] ( ] [ ) ]

Theorem (Book, Brandenburg SICOMP80)

A language L is a queue language

iff L is recognized by a nondeterministic real-time queue machine

iff L = g(h-1(FIFO) R), where FIFO are all FIFO nestings.

Page 30: 34/1 © 2012 Prof. Dr. Franz J. Brandenburg Stacks, Queues,Deques and their Representations as Drawings Franz J. Brandenburg University of Passau joint

34/30

© 2012 Prof. Dr. Franz J. Brandenburg

2-stacks

Theorem (Ginsburg, Greibach 1968)

L is a 2-stack language

iff L is recognized in time n by a nondeterministic TM with two stacks

iff L = g(h-1(S2) R)

where S2 is the shuffle / interleavings of all strings

from two disjoint Dyck sets

i.e. take well nested parenthesis over (), [ ]

and over < >, { }

and then consider all strings which are pairwise well-nested

e.g. < { [ ( > ] } )

Page 31: 34/1 © 2012 Prof. Dr. Franz J. Brandenburg Stacks, Queues,Deques and their Representations as Drawings Franz J. Brandenburg University of Passau joint

34/31

© 2012 Prof. Dr. Franz J. Brandenburg

Deque Languages

Consider the equality set FIFO = Eq(g,h) which characterizes a queue,

say over the alphabet a, b and a, b

Define a (context-free) substitution by

(i) a Dyck a Dyck and b Dyck b Dyck

(ii) a Dyck a Dyck and b Dyck b Dyck

where underscoring means a new alphabet

Thus attach an arbitrary well nested string to the left and right.

Theorem

A language L is a deque language

iff L is recognized in time T(n)=n by a nondeterminstic TM with a deque

iff L = g(h-1( X R),

The language X is the above context-free substitution on FIFO

such that the nesting is complete between any pair of a,b or underscored

Page 32: 34/1 © 2012 Prof. Dr. Franz J. Brandenburg Stacks, Queues,Deques and their Representations as Drawings Franz J. Brandenburg University of Passau joint

34/32

© 2012 Prof. Dr. Franz J. Brandenburg

Interpretation

Queues – at Turingmachines are universal

since they can copy information

since they exactly describe the Post Correspondence Problem

Deques – in formal language theory

behave like queues (FIFO) with context-free substitition

.... if this were true, the name deque = double ended queue

should be

queue with free stack mode

Page 33: 34/1 © 2012 Prof. Dr. Franz J. Brandenburg Stacks, Queues,Deques and their Representations as Drawings Franz J. Brandenburg University of Passau joint

34/33

© 2012 Prof. Dr. Franz J. Brandenburg

Deque ?

The behavior of a deque:

a stack at the tail

a stack at the head

queue mode: an item x moves from the head/tail to the tail/head

headtail ..... 21 43

commuting pipes

U

Page 34: 34/1 © 2012 Prof. Dr. Franz J. Brandenburg Stacks, Queues,Deques and their Representations as Drawings Franz J. Brandenburg University of Passau joint

34/34

© 2012 Prof. Dr. Franz J. Brandenburg

Deque ?

The behavior of a deque:

a stack at the tail

a stack at the head

queue mode: an item x moves from the head/tail to the tail/head

headtail ..... 21 43

remove red to the rightif blue has been removed beforeThe right stack must be empty.UIf emptythe right stack steels the red item

Page 35: 34/1 © 2012 Prof. Dr. Franz J. Brandenburg Stacks, Queues,Deques and their Representations as Drawings Franz J. Brandenburg University of Passau joint

34/35

© 2012 Prof. Dr. Franz J. Brandenburg

Deque ?

The behavior of a deque:

a stack at the tail

a stack at the head

queue mode: if one stack is empty, it steels the deepest item

Steeling Double Stack

Page 36: 34/1 © 2012 Prof. Dr. Franz J. Brandenburg Stacks, Queues,Deques and their Representations as Drawings Franz J. Brandenburg University of Passau joint

34/36

© 2012 Prof. Dr. Franz J. Brandenburg

Generalization

A tripod:

take three stacks

which meet at their bottom and

if a stack is empty, it takes the next item from the bottom of

the next nonempty stack in circular order

Page 37: 34/1 © 2012 Prof. Dr. Franz J. Brandenburg Stacks, Queues,Deques and their Representations as Drawings Franz J. Brandenburg University of Passau joint

34/37

© 2012 Prof. Dr. Franz J. Brandenburg

Queue Graphs

Corollary

The dual G* of a queue graph has an Eulerian path.

Proof: Sweep the drawing from left to right.

Theorem

Tests are NP-hard.

Is G a deque (queue, 2-stack) graph?

Theorem

G is a bipartite queue graph

if and only if

G is proper arch leveled planar (no arches)

Page 38: 34/1 © 2012 Prof. Dr. Franz J. Brandenburg Stacks, Queues,Deques and their Representations as Drawings Franz J. Brandenburg University of Passau joint

34/38

© 2012 Prof. Dr. Franz J. Brandenburg

Arches

When do we get the arches?

... at the ends of the full queue phases

...where can we add edges?

... (3,7) or (4,6)

1 2 3

4 5 6

7 8 9

1 2 3 4 5 6 7 8 9

1 2 3 4 5 6 7 8 9

7

1 2 3

4 5 6

8 9

1 2 3

4 5 6

7 8 9

Page 39: 34/1 © 2012 Prof. Dr. Franz J. Brandenburg Stacks, Queues,Deques and their Representations as Drawings Franz J. Brandenburg University of Passau joint

34/39

© 2012 Prof. Dr. Franz J. Brandenburg

Stacks

4-stacks (Yannakakis (1989))

Every planar graph is a 4-stack graph.

and there are planar graphs which need 4 stacks

3-stacks (Dujmovic, Wood (2005))

Every graph has a 3-stack embedding with O(g(n)) subdivisions

g(n) is minimum of stack-number and queue-number

2-stacks (Di Giacomo et al. (2005), Kaufmann,Wiese (1999) Dujmovic, Wood (2005))

Every planar graph has a 2-stack embedding with 1 subdivision

Page 40: 34/1 © 2012 Prof. Dr. Franz J. Brandenburg Stacks, Queues,Deques and their Representations as Drawings Franz J. Brandenburg University of Passau joint

34/40

© 2012 Prof. Dr. Franz J. Brandenburg

1 Stack + 1 Queue

Drawing style

Example

K5 and K3,3 are 1-stack + 1-queue graphs

K6 and K4,4 are not

Conjecture of Heath and Rosenberg (1992)

Every planar graph is a 1 stack + 1 queue graph.

I say NO!

but my first counterexamples were refuted by A. Gleißner

using a SAT solver

Page 41: 34/1 © 2012 Prof. Dr. Franz J. Brandenburg Stacks, Queues,Deques and their Representations as Drawings Franz J. Brandenburg University of Passau joint

34/41

© 2012 Prof. Dr. Franz J. Brandenburg

Perspectives and Open Problems

• a new drawing style for queues

Dujmovic, Wood (2005)

• planar graphs and 3-stacks• planar graphs and 1-stack+ 1-queue (Heath, Rosenberg conjecture)• stack and queue number: are they related• deque number and its relation to stack (queue) number• a sophisticated data structure to capture all planar graphs