Giraph Travelling Salesman Example

Preview:

DESCRIPTION

Quick brute-force implementation of the Travelling Salesman Problem with Giraph

Citation preview

23

12

33

0

23

12

33

1 2

24

32

31

3

24

32

31

Giraph : Travelling Salesman Problem

10

30

1

0

On the left, we will show the original graph, to know how to process each step

23

12

33

0

23

12

33

1 2

24

32

31

3

24

32

31

Giraph : Travelling Salesman Problem

10

30

1

0

Superstep 0 begins

23

12

33

0

23

12

33

1 2

24

32

31

3

24

32

31

Giraph : Travelling Salesman Problem

10

30

1

Superstep 0 : we compute vertex n°1, nothing to do, it is not the source

23

12

33

0

23

12

33

1 2

24

32

31

3

24

32

31

Giraph : Travelling Salesman Problem

10

30

1

Superstep 0 : we compute vertex n°2, the source

23

12

33

0

23

12

33

1 2

24

32

31

3

24

32

31

2,12+1

Giraph : Travelling Salesman Problem

10

30

1

Superstep :

2,12+30

The source sends all the possible paths and their values to the others nodes

23

12

33

0

23

12

33

1 2

24

32

31

3

24

32

31

2,12+1

Giraph : Travelling Salesman Problem

10

30

1

2,12+30

The source then votes to halt

23

12

33

0

23

12

33

1 2

24

32

31

3

24

32

31

2,12+1

Giraph : Travelling Salesman Problem

10

30

1

2,12+30

Superstep 0 : we compute vertex n°3, nothing happens as it is not the source

23

12

33

0

23

12

33

1

23

33

2

24

32

31

3

24

32

31

2,12+1

12

Giraph : Travelling Salesman Problem

10

30

1

2,12+30

12 12

Superstep 1 begins

23

12

33

0

23

12

33

1

23

33

2

24

32

31

3

24

32

31

2,12+1

12

Giraph : Travelling Salesman Problem

10

30

1

2,12+30

12 12

Superstep 1 : we compute vertex n°1

23

12

33

0

23

12

33

1

23

33

2

24

32

31

3

24

32

31

2,12+1

12

Giraph : Travelling Salesman Problem

10

30

1

2,12+30

21,42+10+23

12 12

Superstep 1 : we compute vertex n°1

23

12

33

0

23

12

33

1

23

33

2

24

32

31

3

24

32

31

2,12+1

12

Giraph : Travelling Salesman Problem

10

30

1

2,12+30

12 12

21,42+10+23

Superstep 1 : we compute vertex n°3

23

12

33

0

23

12

33

1

23

33

2

24

32

31

3

24

32

31

2,12+1

12

Giraph : Travelling Salesman Problem

10

30

1

2,12+30

12 12

23,13+10+33

21,42+10+23

Superstep 1 : we compute vertex n°3

23

12

33

0

23

12

33

1

23

33

2

23

33

3

24

32

31

2,12+1

12

Giraph : Travelling Salesman Problem

10

30

1

2,12+30

12 12

23,13+10+33

21,42+10+23

Superstep 2 begins

12

23

12

33

0

23

12

33

1

23

33

2

23

33

3

24

32

31

2,12+1

12

Giraph : Travelling Salesman Problem

10

30

1

2,12+30

12 12

23,13+10+33

21,42+10+23

Superstep 2 : we compute vertex n°1

12

23

12

33

0

23

12

33

1

23

33

2

23

33

3

24

32

31

2,12+1

12

Giraph : Travelling Salesman Problem

10

30

1

2,12+30

12 12

23,13+10+33

21,42+10+23

231,56+30+23=109

Superstep 2 : we compute vertex n°1

12

23

12

33

0

23

12

33

1

23

33

2

23

33

3

24

32

31

2,12+1

12

Giraph : Travelling Salesman Problem

10

30

1

2,12+30

12 12

23,13+10+33

21,42+10+23

231,56+30+23=109

Superstep 2 : we compute vertex n°3

12

23

12

33

0

23

12

33

1

23

33

2

23

33

3

24

32

31

2,12+1

12

Giraph : Travelling Salesman Problem

10

30

1

2,12+30

12 12

23,13+10+33

21,42+10+23

231,56+30+23=109

213,75+10+33=118

Superstep 2 : we compute vertex n°3

12

23

12

33

0

23

12

33

1

23

33

2

23

33

3

23

12

33

2,12+1

12

Giraph : Travelling Salesman Problem

10

30

1

2,12+30

12 12

23,13+10+33

21,42+10+23

231,56+30+23=109

213,75+10+33=118

12

Superstep 3 begins

12

23

12

33

0

23

12

33

1

23

33

2

23

33

3

23

12

33

2,12+1

12

Giraph : Travelling Salesman Problem

10

30

1

2,12+30

12 12

23,13+10+33

21,42+10+23

231,56+30+23=109

213,75+10+33=118

12

Superstep 3 : we compute vertex n°1

12

23

12

33

0

23

12

33

1

23

33

2

23

33

3

23

12

33

2,12+1

12

Giraph : Travelling Salesman Problem

10

30

1

2,12+30

12 12

23,13+10+33

21,42+10+23

231,56+30+23=109

213,75+10+33=118

12

23

Superstep 3 : we compute vertex n°1 : votes to Halt

12

23

12

33

0

23

12

33

1

23

33

2

23

33

3

23

12

33

2,12+1

12

Giraph : Travelling Salesman Problem

10

30

1

2,12+30

12 12

23,13+10+33

21,42+10+23

231,56+30+23=109

213,75+10+33=118

12

23

Superstep 3 : we compute the source, reactivated by the messages received

12

23

12

33

0

23

12

33

1

23

33

2

23

33

3

23

12

33

2,12+1

12

Giraph : Travelling Salesman Problem

10

30

1

2,12+30

12 12

23,13+10+33

21,42+10+23

231,56+30+23=109

213,75+10+33=118

23

The source compares the values received and finds the minimum distance

12

23

12

33

0

23

12

33

1

23

33

2

23

33

3

23

109

33

2,12+1

12

Giraph : Travelling Salesman Problem

10

30

1

2,12+30

12 12

23,13+10+33

21,42+10+23

231,56+30+23=109

213,75+10+33=118

23

and sets its value as the minimum

12

23

12

33

0

23

12

33

1

23

33

2

23

33

3

23

109

33

2,12+1

12

Giraph : Travelling Salesman Problem

10

30

1

2,12+30

12 12

23,13+10+33

21,42+10+23

231,56+30+23=109

213,75+10+33=118

23

109

The source then votes to Halt

12

23

12

33

0

23

12

33

1

23

33

2

23

33

3

23

109

33

2,12+1

12

Giraph : Travelling Salesman Problem

10

30

1

2,12+30

12 12

23,13+10+33

21,42+10+23

231,56+30+23=109

213,75+10+33=118

23

109

Superstep 3 : we compute vertex n°3

12

23

12

33

0

23

12

33

1

23

33

2

23

33

3

23

109

33

2,12+1

12

Giraph : Travelling Salesman Problem

10

30

1

2,12+30

12 12

23,13+10+33

21,42+10+23

231,56+30+23=109

213,75+10+33=118

23

109

33

Superstep 3 : we compute vertex n°3 : votes to Halt, ends the process

12

Recommended