Interface
MolecularGraph.Graph.addnode!
— Methodaddnode!(graph) -> Int
addnode!(graph, attr) -> Int
Add new node and return the node index. If the node attribute type is required, specify the node attribute object by node
keyword.
MolecularGraph.Graph.clearcache!
— Methodclearcache!(graph::AbstractGraph) -> nothing
Clear calculated property caches.
Calling clearcache!
is recommended when the graph nodes/edges are added, removed or reindexed. You can Graph.clone
the graph before destructive operation instead.
MolecularGraph.Graph.clone
— Functionclone(graph::AbstractGraph) -> AbstractGraph
Return deep copy of the graph.
MolecularGraph.Graph.edgeattr
— Methodedgeattr(graph::AbstractGraph, u::Int, v::Int
) -> Union{AbstractEdge,Nothing}
Return the attribute object of an edge that connects u
and v
. If not found, return nothing.
MolecularGraph.Graph.edgeattr
— Methodedgeattr(graph::AbstractGraph, i::Int) -> AbstractEdge
Return the attribute object of edge i
.
MolecularGraph.Graph.edgeattrs
— Methodedgeattrs(graph::Union{OrderedGraph,OrderedDiGraph}) -> Vector{AbstractEdge}
Return graph edge attributes.
MolecularGraph.Graph.edgeattrtype
— Methodedgeattrtype(graph) -> Type
Return edge attribute type.
MolecularGraph.Graph.edgecount
— Methodedgecount(graph::AbstractGraph) -> Int
Return the number of graph edges.
MolecularGraph.Graph.edgeset
— Methodedgeset(graph::Union{OrderedGraph,OrderedDiGraph}) -> Set{Int}
Return the set of edge keys.
MolecularGraph.Graph.getedge
— Methodgetedge(graph::AbstractGraph, i::Int) -> Tuple{Int,Int}
getedge(graph::HyperGraph, i::Int) -> Set{Int}
Return an edge.
MolecularGraph.Graph.hasedge
— Methodhasedge(graph::UndirectedGraph, u::Int, v::Int) -> Bool
hasedge(graph::DirectedGraph, source::Int, target::Int) -> Bool
Return whether the given two nodes are connected by at least one edge.
MolecularGraph.Graph.indegree
— Methodindegree(graph::DirectedGraph, n::Int) -> Int
Return the number of inneighbors of the node 'n'.
MolecularGraph.Graph.inneighbors
— Methodinneighbors(graph::DirectedGraph, i::Int) -> Dict{Int,Int}
Return the mapping of predecessor node keys and in edge keys connected to the given node.
MolecularGraph.Graph.neighborcount
— Methodneighborcount(graph::AbstractGraph, n::Int) -> Int
degree(graph::AbstractGraph, n::Int) -> Int
Return the number of adjacent nodes of the node 'n'.
MolecularGraph.Graph.neighbors
— Methodneighbors(graph, i) -> Dict{Int,Int}
Return the mapping of incident edges and adjacent nodes of node i
. If the graph is directed graph, both outneighbors and inneighbors are mapped.
MolecularGraph.Graph.nodeattr
— Methodnodeattr(graph::AbstractGraph, i::Int) -> AbstractNode
Return the attribute object of node i
.
MolecularGraph.Graph.nodeattrs
— Methodnodeattrs(graph::Union{OrderedGraph,OrderedDiGraph}) -> Vector{AbstractNode}
Return graph node attributes.
MolecularGraph.Graph.nodeattrtype
— Methodnodeattrtype(graph) -> Type
Return node attribute type.
MolecularGraph.Graph.nodecount
— Methodnodecount(graph::AbstractGraph) -> Int
Return the number of graph nodes.
MolecularGraph.Graph.nodeset
— Methodnodeset(graph::Union{OrderedGraph,OrderedDiGraph}) -> Set{Int}
Return the set of node keys.
MolecularGraph.Graph.outdegree
— Methodoutdegree(graph::DirectedGraph, n::Int) -> Int
Return the number of outneighbors of the node 'n'.
MolecularGraph.Graph.outneighbors
— Methodoutneighbors(graph::DirectedGraph, i::Int) -> Dict{Int,Int}
Return the mapping of successor node keys and out edge keys connected to the given node.
MolecularGraph.Graph.setedgeattr!
— Methodsetedgeattr!(graph::AbstractGraph, i::Int, attr::AbstractNode)
Update the edge attribute.
MolecularGraph.Graph.setnodeattr!
— Methodsetnodeattr!(graph::AbstractGraph, i::Int, attr::AbstractNode)
Update the node attribute.
MolecularGraph.Graph.unlinkedges
— Functionunlinkedges(graph, edges)
Delete given edges from the graph.
MolecularGraph.Graph.unlinknodes
— Functionunlinknodes(graph, nodes)
Delete given nodes and its incident edges from the graph.