Graph

Graphs

Reference

Index

Content

Graph(n_vertices::Integer=0; vertex_type::DataType  = Any ,initial_value=nothing, weight_type::DataType = Float64)

Construct an undirected weighted grpah of n_vertices vertices.

source
function connect!(g::Graph, i::Integer, neighbors::Vector, weigths::Vector)
source
connect!(g::Graph,i::Integer,j::Integer,w::Number)

Connect the vertex i with the vertex j with weight w.

source
disconnect(g::Graph,i::Integer,j::Integer)

Removes the edge that connects the i-th vertex to the j-th vertex.

source
function random_graph(iterations::Integer; probs=[0.4,0.4,0.2], weight=()->5, debug=false)

Create a random graphs. probs is an array of probabilities. The function create a vertex with probability probs[1], connect two vertices with probability probs[2] and delete a vertex with probability probs[2]. The weight of the edges is given by weight

source
remove_vertex!(g::Graph,i::Integer)

Remove the i-th vertex.

source
target_vertex(e::Edge,v::Vertex)

Given an edge e and a vertex v returns the other vertex different from v

source
type Edge
source
Base.lengthMethod.
length(v::Vertex)

Return the number of edges connected to a given vertex.

source
LightGraphs.nvMethod.
nv(g::Graph)

Return the number of vertices of g.

source