我想从 Julia (v0.7) 中的邻接矩阵生成加权和定向网络。
到目前为止,我已经尝试过:
using LightGraphs
using SimpleWeightedGraphs
A = rand(100, 100)
G = Graph(A)
但我得到错误:
ERROR: ArgumentError: Adjacency / distance matrices must be symmetric
Stacktrace:
[1] SimpleGraph{Int64}(::Array{Float64,2}) at /home/user/.julia/packages/LightGraphs/PPsyP/src/SimpleGraphs/simplegraph.jl:78
[2] SimpleGraph(::Array{Float64,2}) at /home/user/.julia/packages/LightGraphs/PPsyP/src/SimpleGraphs/simplegraph.jl:72
[3] top-level scope at none:0
到目前为止,我只在 github ( https://github.com/JuliaGraphs/SimpleWeightedGraphs.jl ) 页面上看到了从边列表生成加权图的示例。但是,如果我可以直接从邻接矩阵生成图形,我会更喜欢。