I am using LightGraphs for a project. I have a distance matrix and I want to find the minimum spanning tree. I am running the following code:
T = CSV.File("samples/distance_matrix.csv")
df = DataFrame(T)
df = df[:,2:end] #because the first column has names (same as the top row)
m = Matrix(df)
sg = SimpleGraph(m)
mst = kruskal_mst(sg) ## or prim_mst(sg)
The MST that I get is incorrect. However, when I write my own kruskal functions, I get the correct the MST.
Can some tell me if I doing something wrong?
"Dense/b"will be plotted as a subgraph named
"b"which can be collapsed/expanded. so large graphs can be named accordingly for better visualization.
G1=SimpleGraph(100,10)with nodes 1:100, and a
G2=SimpleGraph(200,10)with nodes 50:200. I expect some edges to overlap. Obviously, this approach does not work because for G1, the nodes are numbered 1 through 100, while in G2, the nodes are numbered 1 through 150. MetaGraphs seems to be the right way to accomplish my task. Is there a better and perhaps more efficient way? Thanks.