Base

Base

Nodes and Edges

Node and edge types and functions.

AbstractNode{V}

Abstract supertype for all node types, where V is the type of the node key.

source
node_index(v)
node_index(g::AbstractGraph, v)

Return the index of a node v.

source
node_key(v)

Return the key of a node v.

source
Node(index, key)
Node{V}(key)
Node{V}(g, key)

Constructs a Node with node index index of type V and key value key. If only key is given, set index to 0. Node(g, key) constructs a new node in graph g, so index is equal to num_nodes(g) + 1.

Example

julia> using EvolvingGraphs

julia> a = Node(1,"a")
Node(a)

julia> node_index(a)
1

julia> node_key(a)
"a"

julia> b = Node{String}("b")
Node(b)

julia> node_index(b)
0
source
AttributeNode(index, key, attributes=Dict())
AttributeNode{K, D_k, D_v}(key, attributes=Dict())
AttributeNode{K, D_k, D_v}(g, key, attributes=Dict())

Construct an AttributeNode with index index, key value key and attributes attributes. If index is not given, set index = 0. AttributeNode(g, key, attributes) constructs a new AttributeNode for graph g, where index = num_nodes(g) + 1.

Example

julia> using EvolvingGraphs

julia> a = AttributeNode(1, "a", Dict("a" => 12))
AttributeNode(a)

julia> node_key(a)
"a"

julia> node_index(a)
1

julia> node_attributes(a)
Dict{String,Int64} with 1 entry:
  "a" => 12
source
node_attributes(v)
node_attributes(v, g::AbstractGraph)

Returns the attributes of AttributeNode v.

source
TimeNode(index, key, timestamp)
TimeNode{V,T}(key, timestamp)
TimeNode{V,T}(g, key, timestamp)

Constructs a TimeNode at timestamp timestamp. TimeNode(g, key, timestamp) constructs a TimeNode in graph g.

Example

julia> using EvolvingGraphs

julia> t = TimeNode(1, "t", 2018)
TimeNode(t, 2018)

julia> node_index(t)
1

julia> node_key(t)
"t"

julia> node_timestamp(t)
2018
source
node_timestamp(v)

Return the timestamp of TimeNode v.

source
AbstractEdge{V}

Abstract supertype for all edge types, where V represents the type of the source and target nodes.

source
EvolvingGraphs.sourceFunction.
source(e)

Return the source of edge e.

source
EvolvingGraphs.targetFunction.
target(e)

Return the target of edge e.

source
edge_timestamp(e)

Return the timestamp of edge e if e is a time dependent edge, i.e., TimeEdge or WeightedTimeEdge.

Example

julia> using EvolvingGraphs

julia> e1 = TimeEdge("A", "B", 1)
A->B at time 1

julia> edge_timestamp(e1)
1

julia> a = Edge(1, 2)
1->2

julia> edge_timestamp(a)
ERROR: type Edge has no field timestamp
[...]
source
Edge(source, target)

Construct an Edge from a source node and a target node.

source
edge_reverse(e)

Return the reverse of edge e, i.e., source is now target and target is now source.

source
TimeEdge(source, target, timestamp)

Construct a TimeEdge with source node source, target node target at time stamp timestamp.

source
WeightedTimeEdge(source, target, weight, timestamp)
WeightedTimeEdge(source, target, timestamp)

Construct a WeightedTimeEdge. if weight is not given, set weight = 1.0.

source
edge_weight(e)

Returns the edge weight of a WeightedTimeEdge e.

source
has_node(e, v)
has_node(g, v)

In the first case, return true if v is a node of the edge e. In the second case, return true if graph g contains node v and false otherwise, where v can a node type object or a node key.

source

Paths

Path types and functions.

AbstractPath

Abstract supertype for all path types.

source
TemporalPath()

Construct a TemporalPath, i.e., an array of TimeNode.

Example

julia> using EvolvingGraphs

julia> p = TemporalPath()


julia> push!(p, TimeNode(1, "a", 2001))
TimeNode(a, 2001)

julia> push!(p, TimeNode(1, "b", 2002))
TimeNode(a, 2001)->TimeNode(b, 2002)

julia> p
TimeNode(a, 2001)->TimeNode(b, 2002)

julia> append!(p,p)
TimeNode(a, 2001)->TimeNode(b, 2002)->TimeNode(a, 2001)->TimeNode(b, 2002)
source