-
Notifications
You must be signed in to change notification settings - Fork 0
Closed
Description
There are some well-known "rules" for reducing a graph prior to using an exact treewidth solver. I implemented the ones in this paper.
julia> using CliqueTrees, TreeWidthSolver
julia> graph = [
0 0 1 1 1 0 0 0 0 0 0 0 0 0 1 0 0
0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0
1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0
0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0
0 0 0 0 0 0 0 1 1 0 0 0 0 0 1 0 0
0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0
0 0 0 0 1 1 1 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 1 0 1 1 0 0 1
0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 1 1
0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0
0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0
1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 1
0 0 0 0 1 1 0 0 0 0 0 1 0 0 0 0 0
0 0 0 0 0 0 0 0 0 1 0 1 0 0 1 0 0
];
julia> @time treewidth(graph; alg=BT()) # solve using TreeWidthSolver.jl
0.000498 seconds (7.11 k allocations: 543.391 KiB)
3
julia> @time treewidth(graph; alg=RuleReduction(BT())) # reduce graph, then solve using TreeWidthSolver.jl
0.000059 seconds (200 allocations: 18.375 KiB)
3I ran both versions on your benchmark suite. The red points are with rules, the blue points are without.
I thought you might find this interesting!
GiggleLiu and ArrogantGao
Metadata
Metadata
Assignees
Labels
No labels
