47
A Flow Formulation for Horizontal Coordinate Assignment with Prescribed Width Michael Jünger 1 , Petra Mutzel 2 , Christiane Spisla 2 1 University of Cologne, 2 TU Dortmund University Symposium on Graph Drawing and Network Visualization 2018

A Flow Formulation for Horizontal Coordinate Assignment ...dccg.upc.edu/gd2018/wp-content/uploads/2018/11/s4t1.pdf · A Flow Formulation for Horizontal Coordinate Assignment with

  • Upload
    others

  • View
    0

  • Download
    0

Embed Size (px)

Citation preview

Page 1: A Flow Formulation for Horizontal Coordinate Assignment ...dccg.upc.edu/gd2018/wp-content/uploads/2018/11/s4t1.pdf · A Flow Formulation for Horizontal Coordinate Assignment with

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

Page 2: A Flow Formulation for Horizontal Coordinate Assignment ...dccg.upc.edu/gd2018/wp-content/uploads/2018/11/s4t1.pdf · A Flow Formulation for Horizontal Coordinate Assignment with

Introduction

Sugiyama framework

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

A Flow Formulation for Horizontal Coordinate Assignment with Prescribed Width 1

Page 3: A Flow Formulation for Horizontal Coordinate Assignment ...dccg.upc.edu/gd2018/wp-content/uploads/2018/11/s4t1.pdf · A Flow Formulation for Horizontal Coordinate Assignment with

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

Page 4: A Flow Formulation for Horizontal Coordinate Assignment ...dccg.upc.edu/gd2018/wp-content/uploads/2018/11/s4t1.pdf · A Flow Formulation for Horizontal Coordinate Assignment with

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

Page 5: A Flow Formulation for Horizontal Coordinate Assignment ...dccg.upc.edu/gd2018/wp-content/uploads/2018/11/s4t1.pdf · A Flow Formulation for Horizontal Coordinate Assignment with

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

Page 6: A Flow Formulation for Horizontal Coordinate Assignment ...dccg.upc.edu/gd2018/wp-content/uploads/2018/11/s4t1.pdf · A Flow Formulation for Horizontal Coordinate Assignment with

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

Page 7: A Flow Formulation for Horizontal Coordinate Assignment ...dccg.upc.edu/gd2018/wp-content/uploads/2018/11/s4t1.pdf · A Flow Formulation for Horizontal Coordinate Assignment with

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

Page 8: A Flow Formulation for Horizontal Coordinate Assignment ...dccg.upc.edu/gd2018/wp-content/uploads/2018/11/s4t1.pdf · A Flow Formulation for Horizontal Coordinate Assignment with

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

Page 9: A Flow Formulation for Horizontal Coordinate Assignment ...dccg.upc.edu/gd2018/wp-content/uploads/2018/11/s4t1.pdf · A Flow Formulation for Horizontal Coordinate Assignment with

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

Page 10: A Flow Formulation for Horizontal Coordinate Assignment ...dccg.upc.edu/gd2018/wp-content/uploads/2018/11/s4t1.pdf · A Flow Formulation for Horizontal Coordinate Assignment with

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

Page 11: A Flow Formulation for Horizontal Coordinate Assignment ...dccg.upc.edu/gd2018/wp-content/uploads/2018/11/s4t1.pdf · A Flow Formulation for Horizontal Coordinate Assignment with

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

Page 12: A Flow Formulation for Horizontal Coordinate Assignment ...dccg.upc.edu/gd2018/wp-content/uploads/2018/11/s4t1.pdf · A Flow Formulation for Horizontal Coordinate Assignment with

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

Page 13: A Flow Formulation for Horizontal Coordinate Assignment ...dccg.upc.edu/gd2018/wp-content/uploads/2018/11/s4t1.pdf · A Flow Formulation for Horizontal Coordinate Assignment with

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

Page 14: A Flow Formulation for Horizontal Coordinate Assignment ...dccg.upc.edu/gd2018/wp-content/uploads/2018/11/s4t1.pdf · A Flow Formulation for Horizontal Coordinate Assignment with

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

Page 15: A Flow Formulation for Horizontal Coordinate Assignment ...dccg.upc.edu/gd2018/wp-content/uploads/2018/11/s4t1.pdf · A Flow Formulation for Horizontal Coordinate Assignment with

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

Page 16: A Flow Formulation for Horizontal Coordinate Assignment ...dccg.upc.edu/gd2018/wp-content/uploads/2018/11/s4t1.pdf · A Flow Formulation for Horizontal Coordinate Assignment with

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

Page 17: A Flow Formulation for Horizontal Coordinate Assignment ...dccg.upc.edu/gd2018/wp-content/uploads/2018/11/s4t1.pdf · A Flow Formulation for Horizontal Coordinate Assignment with

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

Page 18: A Flow Formulation for Horizontal Coordinate Assignment ...dccg.upc.edu/gd2018/wp-content/uploads/2018/11/s4t1.pdf · A Flow Formulation for Horizontal Coordinate Assignment with

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

Page 19: A Flow Formulation for Horizontal Coordinate Assignment ...dccg.upc.edu/gd2018/wp-content/uploads/2018/11/s4t1.pdf · A Flow Formulation for Horizontal Coordinate Assignment with

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

Page 20: A Flow Formulation for Horizontal Coordinate Assignment ...dccg.upc.edu/gd2018/wp-content/uploads/2018/11/s4t1.pdf · A Flow Formulation for Horizontal Coordinate Assignment with

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

Page 21: A Flow Formulation for Horizontal Coordinate Assignment ...dccg.upc.edu/gd2018/wp-content/uploads/2018/11/s4t1.pdf · A Flow Formulation for Horizontal Coordinate Assignment with

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

Page 22: A Flow Formulation for Horizontal Coordinate Assignment ...dccg.upc.edu/gd2018/wp-content/uploads/2018/11/s4t1.pdf · A Flow Formulation for Horizontal Coordinate Assignment with

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

Page 23: A Flow Formulation for Horizontal Coordinate Assignment ...dccg.upc.edu/gd2018/wp-content/uploads/2018/11/s4t1.pdf · A Flow Formulation for Horizontal Coordinate Assignment with

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

Page 24: A Flow Formulation for Horizontal Coordinate Assignment ...dccg.upc.edu/gd2018/wp-content/uploads/2018/11/s4t1.pdf · A Flow Formulation for Horizontal Coordinate Assignment with

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

Page 25: A Flow Formulation for Horizontal Coordinate Assignment ...dccg.upc.edu/gd2018/wp-content/uploads/2018/11/s4t1.pdf · A Flow Formulation for Horizontal Coordinate Assignment with

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

Page 26: A Flow Formulation for Horizontal Coordinate Assignment ...dccg.upc.edu/gd2018/wp-content/uploads/2018/11/s4t1.pdf · A Flow Formulation for Horizontal Coordinate Assignment with

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

Page 27: A Flow Formulation for Horizontal Coordinate Assignment ...dccg.upc.edu/gd2018/wp-content/uploads/2018/11/s4t1.pdf · A Flow Formulation for Horizontal Coordinate Assignment with

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

Page 28: A Flow Formulation for Horizontal Coordinate Assignment ...dccg.upc.edu/gd2018/wp-content/uploads/2018/11/s4t1.pdf · A Flow Formulation for Horizontal Coordinate Assignment with

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

Page 29: A Flow Formulation for Horizontal Coordinate Assignment ...dccg.upc.edu/gd2018/wp-content/uploads/2018/11/s4t1.pdf · A Flow Formulation for Horizontal Coordinate Assignment with

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

Page 30: A Flow Formulation for Horizontal Coordinate Assignment ...dccg.upc.edu/gd2018/wp-content/uploads/2018/11/s4t1.pdf · A Flow Formulation for Horizontal Coordinate Assignment with

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

Page 31: A Flow Formulation for Horizontal Coordinate Assignment ...dccg.upc.edu/gd2018/wp-content/uploads/2018/11/s4t1.pdf · A Flow Formulation for Horizontal Coordinate Assignment with

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

Page 32: A Flow Formulation for Horizontal Coordinate Assignment ...dccg.upc.edu/gd2018/wp-content/uploads/2018/11/s4t1.pdf · A Flow Formulation for Horizontal Coordinate Assignment with

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

Page 33: A Flow Formulation for Horizontal Coordinate Assignment ...dccg.upc.edu/gd2018/wp-content/uploads/2018/11/s4t1.pdf · A Flow Formulation for Horizontal Coordinate Assignment with

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

Page 34: A Flow Formulation for Horizontal Coordinate Assignment ...dccg.upc.edu/gd2018/wp-content/uploads/2018/11/s4t1.pdf · A Flow Formulation for Horizontal Coordinate Assignment with

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

Page 35: A Flow Formulation for Horizontal Coordinate Assignment ...dccg.upc.edu/gd2018/wp-content/uploads/2018/11/s4t1.pdf · A Flow Formulation for Horizontal Coordinate Assignment with

Example Flows and Corresponding Drawings

δ= 1flow in bluearc cost in red

A Flow Formulation for Horizontal Coordinate Assignment with Prescribed Width 11

Page 36: A Flow Formulation for Horizontal Coordinate Assignment ...dccg.upc.edu/gd2018/wp-content/uploads/2018/11/s4t1.pdf · A Flow Formulation for Horizontal Coordinate Assignment with

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

Page 37: A Flow Formulation for Horizontal Coordinate Assignment ...dccg.upc.edu/gd2018/wp-content/uploads/2018/11/s4t1.pdf · A Flow Formulation for Horizontal Coordinate Assignment with

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

Page 38: A Flow Formulation for Horizontal Coordinate Assignment ...dccg.upc.edu/gd2018/wp-content/uploads/2018/11/s4t1.pdf · A Flow Formulation for Horizontal Coordinate Assignment with

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

Page 39: A Flow Formulation for Horizontal Coordinate Assignment ...dccg.upc.edu/gd2018/wp-content/uploads/2018/11/s4t1.pdf · A Flow Formulation for Horizontal Coordinate Assignment with

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

Page 40: A Flow Formulation for Horizontal Coordinate Assignment ...dccg.upc.edu/gd2018/wp-content/uploads/2018/11/s4t1.pdf · A Flow Formulation for Horizontal Coordinate Assignment with

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

Page 41: A Flow Formulation for Horizontal Coordinate Assignment ...dccg.upc.edu/gd2018/wp-content/uploads/2018/11/s4t1.pdf · A Flow Formulation for Horizontal Coordinate Assignment with

Further constraints

Maximum/exact distances:

set bounds toappropriate values

A Flow Formulation for Horizontal Coordinate Assignment with Prescribed Width 13

Page 42: A Flow Formulation for Horizontal Coordinate Assignment ...dccg.upc.edu/gd2018/wp-content/uploads/2018/11/s4t1.pdf · A Flow Formulation for Horizontal Coordinate Assignment with

Further constraints

Vertical edges:

delete appropriate arcs

A Flow Formulation for Horizontal Coordinate Assignment with Prescribed Width 13

Page 43: A Flow Formulation for Horizontal Coordinate Assignment ...dccg.upc.edu/gd2018/wp-content/uploads/2018/11/s4t1.pdf · A Flow Formulation for Horizontal Coordinate Assignment with

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

Page 44: A Flow Formulation for Horizontal Coordinate Assignment ...dccg.upc.edu/gd2018/wp-content/uploads/2018/11/s4t1.pdf · A Flow Formulation for Horizontal Coordinate Assignment with

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

Page 45: A Flow Formulation for Horizontal Coordinate Assignment ...dccg.upc.edu/gd2018/wp-content/uploads/2018/11/s4t1.pdf · A Flow Formulation for Horizontal Coordinate Assignment with

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

Page 46: A Flow Formulation for Horizontal Coordinate Assignment ...dccg.upc.edu/gd2018/wp-content/uploads/2018/11/s4t1.pdf · A Flow Formulation for Horizontal Coordinate Assignment with

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

Page 47: A Flow Formulation for Horizontal Coordinate Assignment ...dccg.upc.edu/gd2018/wp-content/uploads/2018/11/s4t1.pdf · A Flow Formulation for Horizontal Coordinate Assignment with

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