I am trying to create a simple type of Graph before putting more efforts on the bigger one I will have to create with data implementation and I figured out that add_vertex! was exactly what I needed to add a special type of vertex into my graph. Here is the simple example I tried and I get the reply that add_vertex! is not defined..
module VSRPGraphModule
using Graphs, LightGraphs, MetaGraphs
g = DiGraph()
println(g)
v=ExVertex(1,"ex")
port=VSRPPort()
FillPort(port,"La Havane",10)
v.attributes["port"]=port
println(v.attributes["port"].name)
add_vertex!(g,v)
println(g)
end
And the codes stops at the add_vertex! line returning:
LoadError: UndefVarError: add_vertex! not defined
I did Pkg.update()
I did put the package into julia.
I really don't know why it is not working, is it a problem of the new Julia version 0.6.9 ?
Thanks in advance for your help !
tl;dr Try just using LightGraphs + MetaGraphs (not Graphs).
LightGraphs
and Graphs
are separate packages and I don't think they work together. IIRC Graphs
is no longer maintained so if you can then just use LightGraphs.
Regardless, if you try to use two packages that export the same method (add_vertex!
) you'll need to specify which one you want to call.
e.g. Graphs.add_vertex!
or LightGraphs.add_vertex!
.