Implementing Fixed-Parameter Algorithms Falk Hffner Institut fr - - PowerPoint PPT Presentation

implementing fixed parameter algorithms
SMART_READER_LITE
LIVE PREVIEW

Implementing Fixed-Parameter Algorithms Falk Hffner Institut fr - - PowerPoint PPT Presentation

Data Implementation Evaluation Implementing Fixed-Parameter Algorithms Falk Hffner Institut fr Softwaretechnik und Theoretische Informatik, TU Berlin 20 November 2012 Falk Hffner (TU Berlin) Implementing Fixed-Parameter Algorithms


slide-1
SLIDE 1

Data Implementation Evaluation

Implementing Fixed-Parameter Algorithms

Falk Hüffner

Institut für Softwaretechnik und Theoretische Informatik, TU Berlin

20 November 2012

Falk Hüffner (TU Berlin) Implementing Fixed-Parameter Algorithms 1/20

slide-2
SLIDE 2

Data Implementation Evaluation

Real-world instances

Recommendation

Use real-world data. Easier to “sell” Analysis might lead to new insights and approaches More fun

Falk Hüffner (TU Berlin) Implementing Fixed-Parameter Algorithms 2/20

slide-3
SLIDE 3

Data Implementation Evaluation

Real-world instance sources

Databases

Biological networks Social networks

Falk Hüffner (TU Berlin) Implementing Fixed-Parameter Algorithms 3/20

slide-4
SLIDE 4

Data Implementation Evaluation

Real-world instance sources

Databases

Biological networks Social networks

Web crawling

DBLP coauthor graph Song similarity graph (last.fm) Stock correlation graph Wikipedia inter-language links

Falk Hüffner (TU Berlin) Implementing Fixed-Parameter Algorithms 3/20

slide-5
SLIDE 5

Data Implementation Evaluation

Real-world instance sources

Databases

Biological networks Social networks

Web crawling

DBLP coauthor graph Song similarity graph (last.fm) Stock correlation graph Wikipedia inter-language links

Cooperation

Statistics visualization Power line network

Falk Hüffner (TU Berlin) Implementing Fixed-Parameter Algorithms 3/20

slide-6
SLIDE 6

Data Implementation Evaluation

Parameters

solution size distance from tractable instances (e. g. treewidth) structural parameters (e. g. vertex cover size)

Falk Hüffner (TU Berlin) Implementing Fixed-Parameter Algorithms 4/20

slide-7
SLIDE 7

Data Implementation Evaluation

Parameters

solution size distance from tractable instances (e. g. treewidth) structural parameters (e. g. vertex cover size)

Advertisement

Graphana (http://fpt.akt.tu-berlin.de/graphana/) is a tool that calculates parameters of graphs such as treewidth, connectivity, vertex cover size, cluster vertex deletion number, cluster editing number, h -index, degeneracy, feedback vertex set size, dominating set size, . . .

Falk Hüffner (TU Berlin) Implementing Fixed-Parameter Algorithms 4/20

slide-8
SLIDE 8

Data Implementation Evaluation

Randomly generated instances

Advantages of randomly generated instances

Can have any number and size Can track relation between performance and parameters

Falk Hüffner (TU Berlin) Implementing Fixed-Parameter Algorithms 5/20

slide-9
SLIDE 9

Data Implementation Evaluation

Randomly generated instances

Advantages of randomly generated instances

Can have any number and size Can track relation between performance and parameters Types: Application oriented:

Phylogenetic trees Web graphs DNA sequences

general

Falk Hüffner (TU Berlin) Implementing Fixed-Parameter Algorithms 5/20

slide-10
SLIDE 10

Data Implementation Evaluation

Example: Colorful Components

COLORFUL COMPONENTS

Instance: An undirected graph G = (V , E ) and a coloring of the vertices χ : V → {1, . . . , c}. Task: Delete a minimum number k of edges such that all connected components are colorful, that is, they do not contain two vertices of the same color. Parameter: k

Falk Hüffner (TU Berlin) Implementing Fixed-Parameter Algorithms 6/20

slide-11
SLIDE 11

Data Implementation Evaluation

Example: Colorful Components

COLORFUL COMPONENTS

Instance: An undirected graph G = (V , E ) and a coloring of the vertices χ : V → {1, . . . , c}. Task: Delete a minimum number k of edges such that all connected components are colorful, that is, they do not contain two vertices of the same color. Parameter: k Random model: c: number of colors; n: number of vertices; pv: probability that a component contains a vertex of a certain color; pe: edge probability within component; px: edge probability between components.

Falk Hüffner (TU Berlin) Implementing Fixed-Parameter Algorithms 6/20

slide-12
SLIDE 12

Data Implementation Evaluation

A simple solver

Recommendation

Implement a solver that is as simple as possible.

Advantages

first impression on what solutions look like base line for finding bugs Typically simplest: Branching Integer Linear Programming (ILP)

Falk Hüffner (TU Berlin) Implementing Fixed-Parameter Algorithms 7/20

slide-13
SLIDE 13

Data Implementation Evaluation

Graph Bipartization

Graph Bipartization: Find a minimum size set of vertices in a graph whose removal results in the graph being bipartite.

Falk Hüffner (TU Berlin) Implementing Fixed-Parameter Algorithms 8/20

slide-14
SLIDE 14

Data Implementation Evaluation

Graph Bipartization

Graph Bipartization: Find a minimum size set of vertices in a graph whose removal results in the graph being bipartite.

Falk Hüffner (TU Berlin) Implementing Fixed-Parameter Algorithms 8/20

slide-15
SLIDE 15

Data Implementation Evaluation

ILP for Graph Bipartization

c1, . . . , cn : binary variables (cover) s1, . . . , sn : binary variables (color)

Falk Hüffner (TU Berlin) Implementing Fixed-Parameter Algorithms 9/20

slide-16
SLIDE 16

Data Implementation Evaluation

ILP for Graph Bipartization

c1, . . . , cn : binary variables (cover) s1, . . . , sn : binary variables (color) minimize

n

  • i =1

ci

Falk Hüffner (TU Berlin) Implementing Fixed-Parameter Algorithms 9/20

slide-17
SLIDE 17

Data Implementation Evaluation

ILP for Graph Bipartization

c1, . . . , cn : binary variables (cover) s1, . . . , sn : binary variables (color) minimize

n

  • i =1

ci

  • s. t. ∀{v, w} ∈ E : (sv = sw) ∨ cv ∨ cw

Falk Hüffner (TU Berlin) Implementing Fixed-Parameter Algorithms 9/20

slide-18
SLIDE 18

Data Implementation Evaluation

ILP for Graph Bipartization

c1, . . . , cn : binary variables (cover) s1, . . . , sn : binary variables (color) minimize

n

  • i =1

ci

  • s. t. ∀{v, w} ∈ E : (sv = sw) ∨ cv ∨ cw

which can be expressed as an ILP constraint as

  • s. t. ∀{v, w} ∈ E : sv + sw + (cv + cw) 1

∀{v, w} ∈ E : sv + sw − (cv + cw) 1

Falk Hüffner (TU Berlin) Implementing Fixed-Parameter Algorithms 9/20

slide-19
SLIDE 19

Data Implementation Evaluation

Implementation language

Recommendation

Use a high-level programming language.

Advantages

more rapid development of typically exponential speedups, but only constant-factor slowdown persistent data structures allow simpler and less error-prone implementation of branching algorithms

Falk Hüffner (TU Berlin) Implementing Fixed-Parameter Algorithms 10/20

slide-20
SLIDE 20

Data Implementation Evaluation

Debugging

Recommendation

Verify that your solution is a solution.

Falk Hüffner (TU Berlin) Implementing Fixed-Parameter Algorithms 11/20

slide-21
SLIDE 21

Data Implementation Evaluation

Debugging

Recommendation

Verify that your solution is a solution.

Recommendation

Make automated tests that compare the result of the simple solver with that of the optimized solver, on randomly generated test cases.

Falk Hüffner (TU Berlin) Implementing Fixed-Parameter Algorithms 11/20

slide-22
SLIDE 22

Data Implementation Evaluation

Debugging

Recommendation

Verify that your solution is a solution.

Recommendation

Make automated tests that compare the result of the simple solver with that of the optimized solver, on randomly generated test cases.

Recommendation

Use a test case minimization tool (e. g. http://delta.tigris.org/).

Falk Hüffner (TU Berlin) Implementing Fixed-Parameter Algorithms 11/20

slide-23
SLIDE 23

Data Implementation Evaluation

Debugging

Recommendation

Verify that your solution is a solution.

Recommendation

Make automated tests that compare the result of the simple solver with that of the optimized solver, on randomly generated test cases.

Recommendation

Use a test case minimization tool (e. g. http://delta.tigris.org/).

Recommendation

Use version control.

Falk Hüffner (TU Berlin) Implementing Fixed-Parameter Algorithms 11/20

slide-24
SLIDE 24

Data Implementation Evaluation

Data reduction

Recommendation

Implement data reduction rules.

Advantages

can be combined with approximation, heuristics, fixed-parameter, or other exact algorithms

  • ften very effective, even solve the whole instance

normally, the more, the better

Falk Hüffner (TU Berlin) Implementing Fixed-Parameter Algorithms 12/20

slide-25
SLIDE 25

Data Implementation Evaluation

Heuristic speedups

Heuristic speedups in branching algorithms: Heuristic branching priorities Lower bounds

Falk Hüffner (TU Berlin) Implementing Fixed-Parameter Algorithms 13/20

slide-26
SLIDE 26

Data Implementation Evaluation

Benchmark set

Recommendation

Create a benchmark set using the randomized generator and parameter settings that match those measured in the real-world instances.

Falk Hüffner (TU Berlin) Implementing Fixed-Parameter Algorithms 14/20

slide-27
SLIDE 27

Data Implementation Evaluation

Benchmark set

Recommendation

Create a benchmark set using the randomized generator and parameter settings that match those measured in the real-world instances. c ∈ {3, 5, 8}, n ∈ {60, 100, 170}, pv ∈ {0.4, 0.6, 0.9}, pe ∈ {0.4, 0.6, 0.9}, px ∈ {0.01, 0.02, 0.04}.

Falk Hüffner (TU Berlin) Implementing Fixed-Parameter Algorithms 14/20

slide-28
SLIDE 28

Data Implementation Evaluation

Comparison of algorithms

Time measurements depend on Machine Compiler options Program name Weather . . .

Falk Hüffner (TU Berlin) Implementing Fixed-Parameter Algorithms 15/20

slide-29
SLIDE 29

Data Implementation Evaluation

Comparison of algorithms

Time measurements depend on Machine Compiler options Program name Weather . . . For exponential-time algorithms, averages of running time are useless.

Falk Hüffner (TU Berlin) Implementing Fixed-Parameter Algorithms 15/20

slide-30
SLIDE 30

Data Implementation Evaluation

Comparison of algorithms

10

  • 2

10

  • 1

10 10

1

10

2

time (s) 20 40 60 80 100 instances solved (%)

1 2 3 4 5 6

Falk Hüffner (TU Berlin) Implementing Fixed-Parameter Algorithms 16/20

slide-31
SLIDE 31

Data Implementation Evaluation

Evaluating one algorithm

40 60 80 100 120 140

n

10

  • 2

10

  • 1

10 10

1

10

2

time (s) 5 10 15 20 25 30 35

c

10

  • 2

10

  • 1

10 10

1

10

2

time (s) 0.0 0.2 0.4 0.6 0.8 1.0

pv

10

  • 2

10

  • 1

10 10

1

10

2

time (s) 0.0 0.2 0.4 0.6 0.8 1.0

pe

10

  • 2

10

  • 1

10 10

1

10

2

time (s) 0.03 0.04 0.05 0.06 0.07 0.08

px

10

  • 2

10

  • 1

10 10

1

10

2

time (s)

Falk Hüffner (TU Berlin) Implementing Fixed-Parameter Algorithms 17/20

slide-32
SLIDE 32

Data Implementation Evaluation

Evaluate solution quality

Solutions are optimal, but might not match real-world truth due to model deficiencies.

שינקן Пармская ветчина 火腿 Prosciutto crudo Prosciutto di Parma Jambon de Parme Jamón Prosciutto Пршут Parmaschinken Прошутто Ham פרושוטו Prosciutto Ветчина Jamón de Parma Окорок Schinken Jambon

Falk Hüffner (TU Berlin) Implementing Fixed-Parameter Algorithms 18/20

slide-33
SLIDE 33

Data Implementation Evaluation

Evaluate solution quality

2 4 6 8 10 12 14 16 18 20 22 cluster size 20 40 60 80 100 total number

min-cut without DR min-cut with DR column generation

Falk Hüffner (TU Berlin) Implementing Fixed-Parameter Algorithms 19/20

slide-34
SLIDE 34

Data Implementation Evaluation

Finally

Recommendation

Make source and data available under a free license.

Falk Hüffner (TU Berlin) Implementing Fixed-Parameter Algorithms 20/20