Graph
JSMDInterfaces.Graph.AbstractJSMDGraph
— TypeAbstractJSMDGraph{T}
Abstract type for graphs. Subtype it to create graphs compatible with the JSMD ecosystem.
Graphs here could be compatible with both JSMD ecosystem and Graphs.jl
:
- For
JSMD
compatibility, see also:get_path
. - For
Graphs.jl
compatibility, see also: Graphs.jl interface
JSMDInterfaces.Graph.AbstractJSMDGraphNode
— TypeAbstractJSMDGraphNode
Abstract type for graph nodes. Subtype it to create a node graph compatible with the JSMD ecosystem.
Graphs.SimpleGraphs.add_edge!
— Methodadd_edge!(g::AbstractJSMDGraph, from::Int, to::Int, cost::Int)
This function add an edge between from
and to
with weight cost
.
Graphs.SimpleGraphs.add_vertex!
— Methodadd_node!(g::AbstractJSMDGraph, vertex::AbstractJSMDGraphNode)
This function adds vertex
to the graph g
.
Graphs.has_path
— Methodhas_path(g::AbstractJSMDGraph, from::Int, to::Int)
Return true if there is a path between from
and to
in the graph g
.
JSMDInterfaces.Graph.get_path
— Methodget_path(g::AbstractJSMDGraph, from::Int, to::Int)
Get the nodes on hte path between and including from' and
to. Returns an empty array if either
fromor
toare not part of
g` or if there is no path between them.