0x0584/Lem-in

re_wire paths that are crossed

Closed this issue · 4 comments

About

This is the second step after #1: getting the paths

The following barfarm graph is

42
##start
0 23 3
1 16 3
2 16 5
3 9 3
4 1 5
5 4 8
6 4 19
7 11 19
8 77 56
9 18 99
##end
10 9 5
#edges
0-1
0-3
0-2
1-5
1-4
2-6
3-5
3-6
5-6
4-7
4-8
8-10
9-10
2-4
5-7
6-9
7-10
Visually paths (see #1 and #3)
EPIDidACcaYiGnsI aww-board (5)

Example collusion:

Going back from the sink to the source, we face the first collision at 4-7 and it's residual 7-4 there's a collusion between path 1 and path 2, remove both of them and merge the opposite other half

aww-board (7)

Keeping doing that until all edges arrive. Finally, the paths should be

path 1 path 2 path 3
p1 p2 p3

Fix paths for this map

4
3 2 2
##start
start 4 0
##end
end 4 6
4 0 4
1 4 2
2 4 4
5 8 2
6 8 4
start-1
3-4
2-4
1-5
6-5
end-6
1-2
2-end
3-start

Fix this map!!

42
##start
0 23 3
#comment
1 16 3
2 16 5
3 9 3
4 1 5
5 4 8
6 4 19
7 11 19
8 77 56
9 18 99
##end
10 9 5
#edges
0-1
0-3
0-2
1-5
1-4
# create a dead end
# 1-5
# adding other edges
2-6
# 2-7
3-5
3-6
5-7
3-4
1-7
4-7
4-8
8-10
9-10
2-4
5-7
6-9
7-10

TODO:

  • fix bug #6, weirdly a walking edge is set to NULL somehow??
  • fix issue #2, cleaning that messy code
    • bfs_find()
    • re_wire_path() by adding { has_collision(e1, e2, &residual, &edge), cut_collision(residual, edge), do_rewire(path1, e1, path2, e2) }
    • place *_dump and the other queue helpers in separate file(s)