Network Types and Interface
Networks in Erdos.jl are graphs with additional ability to store properties associated to vertices, edges and the graph itself. The ready to go network types are the Network and DiNetwork types. Custom types con be defined inheriting from ANetwork and ADiNetwork abstract types.
Abstract Types
Erdos.ANetwork — Typeabstract type ANetwork <: AGraph endAn abstract graph with the additional possibility to attach properties to vertices and edges.
Erdos.ADiNetwork — Typeabstract type ADiNetwork <: ADiGraph endAn abstract directed graph with the additional possibility to attach properties to vertices and edges.
Erdos.AIndexedEdge — Typeabstract type AIndexedEdge <: AEdge endEdge types with unique indexes, accessed by idx
Network / DiNetwork / IndexedEdge
Erdos.Network — TypeNetworkA type representing a graph with indexed edges and the possibility to store graph/vertex/edge properties.
Network(n=0)Construct a Network with n vertices and no edges.
Network(adjmx::AbstractMatrix; selfedges=true, upper=false)Construct a Network from the adjacency matrix adjmx, placing an edge in correspondence to each nonzero element of adjmx. If selfedges=false the diagonal elements of adjmx are ignored. If upper=true only the upper triangular part of adjmx is considered.
Erdos.DiNetwork — TypeDiNetworkA type representing a directed graph with indexed edges and the possibility to store graph/vertex/edge properties.
DiNetwork(n=0)Construct a DiNetwork with n vertices and no edges.
DiNetwork(adjmx::AbstractMatrix; selfedges=true)Construct a DiNetwork from the adjacency matrix adjmx. If selfedges=false the diagonal elements of adjmx are ignored.
Erdos.IndexedEdge — Typestruct IndexedEdge <: AIndexedEdge
src::Int
dst::Int
idx::Int
endAn indexed edge type
IndexedEdge(u, v) = IndexedEdge(u,v,-1)Creates an edge with invalid index.
Defining new network types
In order to define a custom network type, e.g. MyNet <: ANetwork, the corresponding methods in the preceding paragraph have to be implemented. This is automatically done for custom network types having a props::PropertyStore member. Take a look to src/factory/network.jl and src/maps/property_store.jl for an example.