We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a66b5d3 commit f18db3eCopy full SHA for f18db3e
src/configurations.jl
@@ -25,7 +25,7 @@ function best_solutions(gp::GraphProblem; all=false, usecuda=false, invert=false
25
throw(ArgumentError("ConfigEnumerator can not be computed on GPU!"))
26
end
27
xst = generate_tensors(_x(Tropical{T}; invert), gp)
28
- ymask = trues(fill(2, length(getiyv(gp.code)))...)
+ ymask = trues(fill(nflavor(gp), length(getiyv(gp.code)))...)
29
if usecuda
30
xst = togpu.(xst)
31
ymask = togpu(ymask)
test/networks/Coloring.jl
@@ -33,4 +33,36 @@ end
33
g = SimpleGraph(4)
34
pb = Coloring{3}(g)
35
@test solve(pb, SizeMax()) !== 4
36
+end
37
+
38
+@testset "planar gadget checking" begin
39
+ function graph_crossing_gadget()
40
+ edges = [
41
+ (1,2), (2, 3), (3, 4), (4, 5), (5, 6), (6, 7), (7, 8), (8, 1),
42
+ (9, 10), (10, 11), (11, 12), (12, 9),
43
+ (1, 9), (3, 10), (5, 11), (7, 12),
44
+ (2, 10), (4, 11), (6, 12), (8, 9),
45
+ (13, 9), (13, 10), (13, 11), (13, 12),
46
+ ]
47
+ g = SimpleGraph(13)
48
+ for (i, j) in edges
49
+ add_edge!(g, i, j)
50
+ end
51
+ return g
52
53
54
+ g = graph_crossing_gadget()
55
+ problem = Coloring{3}(g; openvertices=[3, 5])
56
+ res = solve(problem, ConfigsMax())
57
+ for i=1:3
58
+ for ci in res[i,i].c
59
+ @test ci[1] === ci[3] === ci[5] === ci[7] == i-1
60
61
62
+ for (i, j) in [(1, 2), (1, 3), (2, 3), (2,1), (3, 1), (3, 2)]
63
+ for ci in res[i,j].c
64
+ @test ci[1] === ci[5] == j-1
65
+ @test ci[3] === ci[7] == i-1
66
67
68
0 commit comments