A Flow Formulation for Horizontal Coordinate Assignment...

Preview:

Citation preview

A Flow Formulation for Horizontal CoordinateAssignment with Prescribed Width

Michael Jünger1, Petra Mutzel2, Christiane Spisla2

1University of Cologne, 2TU Dortmund University

Symposium on Graph Drawingand Network Visualization 2018

Introduction

Sugiyama framework

• (Cycle breaking)• Layer assignment• Crossing minimization• Coordinate assignment• (Edge routing)

A Flow Formulation for Horizontal Coordinate Assignment with Prescribed Width 1

Introduction

Coordinate assignment

Input:• DAG G

• Layering L• Vertex ordering ord

Output:• Feasible x-coordinates, i.e.x(u)+δ≤ x(v),if ord(u) < ord(v)

A Flow Formulation for Horizontal Coordinate Assignment with Prescribed Width 2

Introduction

Coordinate assignment

Goals:• Short horizontal edge lengths→[Gansner et al., 1993]

• Balanced node positions→[Buchheim et al., 2000],→[Brandes and Köpf, 2001]

• Vertical edges

A Flow Formulation for Horizontal Coordinate Assignment with Prescribed Width 2

Introduction

Coordinate assignment

Goals:• Short horizontal edge lengths→[Gansner et al., 1993]

• Balanced node positions→[Buchheim et al., 2000],→[Brandes and Köpf, 2001]

• Vertical edges

A Flow Formulation for Horizontal Coordinate Assignment with Prescribed Width 2

Introduction

Coordinate assignment

Goals:• Short horizontal edge lengths→[Gansner et al., 1993]

• Balanced node positions→[Buchheim et al., 2000],→[Brandes and Köpf, 2001]

• Vertical edges

A Flow Formulation for Horizontal Coordinate Assignment with Prescribed Width 2

Introduction

Coordinate assignment

Goals:• Short horizontal edge lengths→[Gansner et al., 1993]

• Balanced node positions→[Buchheim et al., 2000],→[Brandes and Köpf, 2001]

• Vertical edges

What about the width?

A Flow Formulation for Horizontal Coordinate Assignment with Prescribed Width 2

Introduction

• Width of the layering:maximum number of nodes in a layer →[Coffman and Graham, 1972]

6= Width of the drawing:maximum horizontal distance between any two nodes

· · ·k

width = 1edge length = k −3

· · ·k

width = k −2edge length = 0

A Flow Formulation for Horizontal Coordinate Assignment with Prescribed Width 3

Introduction

• Width of the layering:maximum number of nodes in a layer →[Coffman and Graham, 1972]

6= Width of the drawing:maximum horizontal distance between any two nodes

· · ·k

width = 1edge length = k −3

· · ·k

width = k −2edge length = 0

A Flow Formulation for Horizontal Coordinate Assignment with Prescribed Width 3

Introduction

• Width of the layering:maximum number of nodes in a layer →[Coffman and Graham, 1972]

6= Width of the drawing:maximum horizontal distance between any two nodes

· · ·k

width = 1edge length = k −3

· · ·k

width = k −2edge length = 0

A Flow Formulation for Horizontal Coordinate Assignment with Prescribed Width 3

Our Contribution

Efficient algorithm for drawings with minimized total edge lengthunder the restriction of bounded drawing width.

In addition it realizes• vertical inner segments• minimum/maximum/exact distances between nodes

Method: Minimum cost flow formulation

Method:

for the coordinate assignment problem

A Flow Formulation for Horizontal Coordinate Assignment with Prescribed Width 4

Our Contribution

Efficient algorithm for drawings with minimized total edge lengthunder the restriction of bounded drawing width.

In addition it realizes• vertical inner segments• minimum/maximum/exact distances between nodes

Method: Minimum cost flow formulation

Method:

for the coordinate assignment problem

A Flow Formulation for Horizontal Coordinate Assignment with Prescribed Width 4

Our Contribution

Efficient algorithm for drawings with minimized total edge lengthunder the restriction of bounded drawing width.

In addition it realizes• vertical inner segments• minimum/maximum/exact distances between nodes

Method: Minimum cost flow formulation

Method:

for the coordinate assignment problem

A Flow Formulation for Horizontal Coordinate Assignment with Prescribed Width 4

Network Construction

Idea:• Network with super sourceand super sink

• Send flow from top tobottom

• Flow = horizontal distance• Cost = edge length

A Flow Formulation for Horizontal Coordinate Assignment with Prescribed Width 5

Network Construction

Idea:• Network with super sourceand super sink

• Send flow from top tobottom

• Flow = horizontal distance• Cost = edge length

A Flow Formulation for Horizontal Coordinate Assignment with Prescribed Width 5

Network Construction

Minimum distance δ between nodes+

Flow means distance

⇒ Network arcs between nodeswith lower bound δ

A Flow Formulation for Horizontal Coordinate Assignment with Prescribed Width 6

Network Construction

⇒ x-coordinate for node v :

x(v)= ∑a left of v

f (a),

where f (a) is the flow overnetwork arc a

A Flow Formulation for Horizontal Coordinate Assignment with Prescribed Width 6

Network Construction

Send flow along layers andover some inter-layer connectionswithout lower or upper bounds

A Flow Formulation for Horizontal Coordinate Assignment with Prescribed Width 7

Network Construction

Connections between layers:• arc from leftmost uppernode to leftmost lower node

• arc from rightmost uppernode to rightmost lowernode

• in hug situations:two network nodes enclosedby graph edges

A Flow Formulation for Horizontal Coordinate Assignment with Prescribed Width 8

Network Construction

Connections between layers:• arc from leftmost uppernode to leftmost lower node

• arc from rightmost uppernode to rightmost lowernode

• in hug situations:two network nodes enclosedby graph edges

A Flow Formulation for Horizontal Coordinate Assignment with Prescribed Width 8

Network Construction

Connections between layers:• arc from leftmost uppernode to leftmost lower node

• arc from rightmost uppernode to rightmost lowernode

• in hug situations:two network nodes enclosedby graph edges

A Flow Formulation for Horizontal Coordinate Assignment with Prescribed Width 8

Network Construction

Connections between layers:• arc from leftmost uppernode to leftmost lower node

• arc from rightmost uppernode to rightmost lowernode

• in hug situations:two network nodes enclosedby graph edges

A Flow Formulation for Horizontal Coordinate Assignment with Prescribed Width 8

Network Construction

Connections between layers:• arc from leftmost uppernode to leftmost lower node

• arc from rightmost uppernode to rightmost lowernode

• in hug situations:two network nodes enclosedby graph edges

A Flow Formulation for Horizontal Coordinate Assignment with Prescribed Width 8

Network Construction

Cost corresponds to edge lengthand flow corresponds to distance

⇒ cost = number of crossed edges

A Flow Formulation for Horizontal Coordinate Assignment with Prescribed Width 9

Network Construction

Cost corresponds to edge lengthand flow corresponds to distance

⇒ cost = number of crossed edges

A Flow Formulation for Horizontal Coordinate Assignment with Prescribed Width 9

Network Construction

Cost corresponds to edge lengthand flow corresponds to distance

⇒ cost = number of crossed edges

A Flow Formulation for Horizontal Coordinate Assignment with Prescribed Width 9

Network Construction

Cost corresponds to edge lengthand flow corresponds to distance

⇒ cost = number of crossed edges

A Flow Formulation for Horizontal Coordinate Assignment with Prescribed Width 9

Network Construction

Cost corresponds to edge lengthand flow corresponds to distance

⇒ cost = number of crossed edges

A Flow Formulation for Horizontal Coordinate Assignment with Prescribed Width 9

Network Construction

super source and super sink

cost= 1lower bound= 0

(or 0)

upper bound=∞

blaaaaaaaa

A Flow Formulation for Horizontal Coordinate Assignment with Prescribed Width 10

Network Construction

super source and super sink

cost= 2lower bound= 0

(or 0)

upper bound=∞

blaaaaaaaa

A Flow Formulation for Horizontal Coordinate Assignment with Prescribed Width 10

Network Construction

super source and super sink

cost= 3lower bound= 0

(or 0)

upper bound=∞

blaaaaaaaa

A Flow Formulation for Horizontal Coordinate Assignment with Prescribed Width 10

Network Construction

super source and super sink

cost= 0lower bound= 0

(or 0)

upper bound=∞

blaaaaaaaa

A Flow Formulation for Horizontal Coordinate Assignment with Prescribed Width 10

Network Construction

super source and super sink

cost= 0lower bound= δ (or 0)upper bound=∞

blaaaaaaaa

A Flow Formulation for Horizontal Coordinate Assignment with Prescribed Width 10

Network Construction

super source and super sink

cost= 0lower bound= 0

(or 0)

upper bound=∞

blaaaaaaaa

A Flow Formulation for Horizontal Coordinate Assignment with Prescribed Width 10

Example Flows and Corresponding Drawings

δ= 1flow in bluearc cost in red

A Flow Formulation for Horizontal Coordinate Assignment with Prescribed Width 11

Example Flows and Corresponding Drawings

1 1

1 1

12

11

1

2 1

1

2

∑cost ·flow= 2 ·1+1 ·1+1 ·1

= 4

A Flow Formulation for Horizontal Coordinate Assignment with Prescribed Width 11

Example Flows and Corresponding Drawings

1 1

1 1 11

1

11

1

1

1

1

1

1

1

∑cost ·flow= 2 ·1+1 ·1

+1 ·1

= 3

A Flow Formulation for Horizontal Coordinate Assignment with Prescribed Width 11

Results

Main TheoremEvery minimum cost flow in network described above definesfeasible x-coordinates and minimum total horizontal edge length.

What about other contraints?

A Flow Formulation for Horizontal Coordinate Assignment with Prescribed Width 12

Results

Main TheoremEvery minimum cost flow in network described above definesfeasible x-coordinates and minimum total horizontal edge length.

What about other contraints?

A Flow Formulation for Horizontal Coordinate Assignment with Prescribed Width 12

Further constraints

Width:

split super source andset upper bound of new arcto maximum width

A Flow Formulation for Horizontal Coordinate Assignment with Prescribed Width 13

Further constraints

Maximum/exact distances:

set bounds toappropriate values

A Flow Formulation for Horizontal Coordinate Assignment with Prescribed Width 13

Further constraints

Vertical edges:

delete appropriate arcs

A Flow Formulation for Horizontal Coordinate Assignment with Prescribed Width 13

Computational results

Test set: 1277 graphs, |V| = 10-100 (subset of AT&T)Implementation: OGDF, network simplex algorithm

100

120

140

160

180

MCF GKNV LP BJL BK

perc

ent

to m

inim

um

widthedge length

0.01

0.02

0.03

0.04

0.05

MCF GKNV LP BJL BK

runnin

g t

ime in s

ec.

time

A Flow Formulation for Horizontal Coordinate Assignment with Prescribed Width 14

Conclusion

• Minimum cost flow formulation for the coordinate assignment problem• Minimize edge length while respecting further constraints• Comparable running time to state-of-the-art algorithms

GKNVwidth: 13, edge length: 54

MCFwidth: 9, edge length: 58

A Flow Formulation for Horizontal Coordinate Assignment with Prescribed Width 15

Conclusion

• Minimum cost flow formulation for the coordinate assignment problem• Minimize edge length while respecting further constraints• Comparable running time to state-of-the-art algorithms

GKNVwidth: 13, edge length: 54

MCFwidth: 9, edge length: 58

A Flow Formulation for Horizontal Coordinate Assignment with Prescribed Width 15

References I

Brandes, U. and Köpf, B. (2001).Fast and simple horizontal coordinate assignment.In Mutzel, P., Jünger, M., and Leipert, S., editors, Graph Drawing, 9thInternational Symposium, GD 2001 Vienna, Austria, September 23-26,2001, Revised Papers, volume 2265 of Lecture Notes in ComputerScience, pages 31–44. Springer.

Buchheim, C., Jünger, M., and Leipert, S. (2000).A fast layout algorithm for k-level graphs.In Marks, J., editor, Graph Drawing, 8th International Symposium, GD2000, Colonial Williamsburg, VA, USA, September 20-23, 2000,Proceedings, volume 1984 of Lecture Notes in Computer Science,pages 229–240. Springer.

A Flow Formulation for Horizontal Coordinate Assignment with Prescribed Width 16

References II

Coffman, E. G. and Graham, R. L. (1972).Optimal scheduling for two-processor systems.Acta Informatica, 1(3):200–213.

Gansner, E. R., Koutsofios, E., North, S. C., and Vo, K.-P. (1993).A technique for drawing directed graphs.Software Engineering, 19(3):214–230.

A Flow Formulation for Horizontal Coordinate Assignment with Prescribed Width 17

Recommended