Skip to content

Commit e2b4862

Browse files
Add further test of PMFG
1 parent 7a2899c commit e2b4862

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

test/spanningtrees/planar_maximally_filtered_graph.jl

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,18 @@
3131
C = X' * X
3232
p = planar_maximally_filtered_graph(g, C)
3333
@test typeof(p) == SimpleGraph{eltype(g)}
34-
end
34+
35+
#Test that MST is a subset of the PMFG
36+
N = 50
37+
X = rand(N, N); D = X'*X
38+
c = complete_graph(N)
39+
p = planar_maximally_filtered_graph(c, D)
40+
mst_edges = kruskal_mst(c, D)
41+
is_subgraph = true
42+
for mst_edge in mst_edges
43+
if mst_edge edges(p)
44+
is_subgraph = false
45+
end
46+
end
47+
@test is_subgraph
48+
end

0 commit comments

Comments
 (0)