I’m using the LightGraphs package and I’m trying to write a simple weighted digraph to a file:
julia> g
{32768, 467633} directed simple Int64 graph with Float64 weights
julia> savegraph("testwt.lg",g)
1
julia> gl=loadgraph("testwt.lg")
ERROR: ArgumentError: invalid base 10 digit 'g' in "graph"
Stack trace
Stacktrace:
[1] tryparse_internal(::Type{Int64}, ::SubString{String}, ::Int64, ::Int64, ::Int64, ::Bool) at ./parse.jl:132
[2] #parse#347(::Nothing, ::typeof(parse), ::Type{Int64}, ::SubString{String}) at ./parse.jl:238
[3] parse at ./parse.jl:238 [inlined]
[4] _parse_header(::SubString{String}) at /Users/eaubanel/.julia/packages/LightGraphs/UPjU9/src/persistence/lg.jl:65
[5] loadlg(::IOStream, ::String) at /Users/eaubanel/.julia/packages/LightGraphs/UPjU9/src/persistence/lg.jl:104
[6] loadgraph at /Users/eaubanel/.julia/packages/LightGraphs/UPjU9/src/persistence/lg.jl:147 [inlined]
[7] #117 at /Users/eaubanel/.julia/packages/LightGraphs/UPjU9/src/persistence/common.jl:15 [inlined]
[8] #open#271(::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}, ::typeof(open), ::LightGraphs.var"#117#118"{String,LGFormat}, ::String, ::Vararg{String,N} where N) at ./io.jl:298
[9] open at ./io.jl:296 [inlined]
[10] loadgraph at /Users/eaubanel/.julia/packages/LightGraphs/UPjU9/src/persistence/common.jl:14 [inlined]
[11] loadgraph(::String) at /Users/eaubanel/.julia/packages/LightGraphs/UPjU9/src/persistence/common.jl:18
[12] top-level scope at none:0
What am I doing wrong? Reading and writing this way works fine for unweighted digraphs.