Reference

IndexedGraphs.AbstractIndexedEdgeType
AbstractIndexedEdge{T<:Integer} <: AbstractEdge{T}

Abstract type for indexed edge. AbstractIndexedEdge{T}s must have the following elements:

  • idx::T integer positive index
source
IndexedGraphs.AbstractIndexedGraphType
AbstractIndexedGraph{T} <: AbstractGraph{T}

An abstract type representing an indexed graph. AbstractIndexedGraphs must have the following elements:

  • A::SparseMatrixCSC adjacency matrix
source
IndexedGraphs.BipartiteGraphVertexType
BipartiteGraphVertex

A BipartiteGraphVertex{LR<:LeftorRight,T<:Integer} represents a vertex in a bipartite graph.

PARAMETERS

FIELDS

  • i – The index of the vertex within its block.
source
IndexedGraphs.BipartiteIndexedGraphMethod
BipartiteIndexedGraph(A::AbstractMatrix)

Construct a BipartiteIndexedGraph from adjacency matrix A with the convention that rows are vertices belonging to the left block, columns to the right block

source
IndexedGraphs.BipartiteIndexedGraphType
BipartiteIndexedGraph{T<:Integer} <: AbstractIndexedGraph{T}

A type representing a sparse, undirected bipartite graph.

FIELDS

  • A – adjacency matrix filled with NullNumbers. Rows are vertices belonging to the left block, columns to the right block
  • X – square matrix for efficient access by row. X[j,i] points to the index of element A[i,j] in A.nzval.
source
IndexedGraphs.IndexedBiDiGraphMethod
IndexedBiDiGraph(A::AbstractMatrix)

Construct an IndexedBiDiGraph from the adjacency matrix A.

IndexedBiDiGraph internally stores the transpose of A. To avoid overhead due to the transposition, use IndexedBiDiGraph(transpose(At)) where At is the transpose of A.

source
IndexedGraphs.IndexedBiDiGraphMethod
IndexedBiDiGraph(A::AbstractSimpleGraph)

Construct an IndexedBiDiGraph from any AbstractSimpleGraph (Graphs.jl), directed or otherwise.

source
IndexedGraphs.IndexedBiDiGraphType
IndexedBiDiGraph{T<:Integer} <: AbstractIndexedDiGraph{T}

A type representing a sparse directed graph with access to both outedges and inedges.

FIELDS

  • A – square matrix filled with NullNumbers. A[i,j] corresponds to edge j=>i.
  • X – square matrix for efficient access by row. X[j,i] points to the index of element A[i,j] in A.nzval.
source
IndexedGraphs.IndexedDiGraphMethod
IndexedDiGraph(A::AbstractMatrix)

Constructs a IndexedDiGraph from the adjacency matrix A.

IndexedDiGraph internally stores the transpose of A. To avoid overhead due to the transposition, use IndexedDiGraph(transpose(At)) where At is the transpose of A.

source
IndexedGraphs.IndexedDiGraphMethod
IndexedDiGraph(A::AbstractSimpleGraph)

Construct an IndexedDiGraph from any AbstractSimpleGraph (Graphs.jl), directed or otherwise.

source
IndexedGraphs.IndexedDiGraphType
IndexedDiGraph{T<:Integer} <: AbstractIndexedDiGraph{T}

A type representing a sparse directed graph with access only to outedges.

FIELDS

  • A – square matrix filled with NullNumbers. A[i,j] corresponds to an edge j=>i
source
IndexedGraphs.IndexedEdgeType
IndexedEdge{T<:Integer} <: AbstractIndexedEdge{T}

Edge type for IndexedGraphs. Edge indices can be used to access edge properties stored in separate containers.

source
IndexedGraphs.IndexedGraphType
IndexedGraph{T<:Integer} <: AbstractIndexedGraph{T}

A type representing a sparse undirected graph.

FIELDS

  • A – square adjacency matrix. A[i,j] == A[j,i] contains the unique index associated to unidrected edge (i,j)
source
Graphs.LinAlg.adjacency_matrixFunction
adjacency_matrix(g::BipartiteIndexedGraph, T::DataType=Int)

Return the symmetric adjacency matrix of size nv(g) = nv_left(g) + nv_right(g) where no distinction is made between left and right nodes.

source
Graphs.edgesMethod
edges(g::IndexedGraph, i::Integer)

Return a lazy iterators to the edges incident to i.

By default unordered edges sort source and destination nodes in increasing order. See outedges and inedges if you need otherwise.

source
Graphs.inneighborsMethod
inneighbors(g::BipartiteIndexedGraph, i::Integer)

Return a lazy iterator to the neighbors of variable i specified by its linear index.

source
Graphs.outneighborsMethod
outneighbors(g::BipartiteIndexedGraph, i::Integer)

Return a lazy iterator to the neighbors of variable i specified by its linear index.

source
IndexedGraphs.bidirected_with_mappingsMethod
bidirected_with_mappings(g::IndexedGraph) -> (gdir, dir2undir, undir2dir)

Construct an IndexedBiDiGraph gdir from an IndexedGraph g by building two directed edges per every undirected edge in g. In addition, return two vectors containing mappings from the undirected edges of g to the corresponding directed edges of gdir.

OUTPUT

  • gdir – The directed graph
  • dir2undir – A vector of integers mapping the indices of the directed edges of gdir to the corresponding undirected edges of g
  • undir2dir – A vector of vectors with two integers each mapping the indices of the undirected edges of g to the two corresponding directed edges of gdir
source
IndexedGraphs.get_edgeMethod
get_edge(g::AbstractIndexedDiGraph, src::Integer, dst::Integer)
get_edge(g::AbstractIndexedDiGraph, id::Integer)

Get edge given source and destination or given edge index.

source
IndexedGraphs.get_edgeMethod
get_edge(g::IndexedGraph, src::Integer, dst::Integer)
get_edge(g::IndexedGraph, id::Integer)

Get edge given source and destination or given edge index.

source
IndexedGraphs.inedgesMethod
inedges(g::BipartiteIndexedGraph, v::BipartiteGraphVertex{<:LeftorRight})

Return a lazy iterator to the edges incident on a variable v specified by a BipartiteGraphVertex, with v as the destination.

source
IndexedGraphs.inedgesMethod
inedges(g::BipartiteIndexedGraph, i::Integer)

Return a lazy iterator to the edges incident on a variable i specified by its linear index, with i as the destination.

source
IndexedGraphs.inedgesMethod
inedges(g::AbstractIndexedBiDiGraph, i::Integer)

Return a lazy iterator to the edges ingoing to node i in g.

source
IndexedGraphs.inedgesMethod
inedges(g::IndexedGraph, i::Integer)

Return a lazy iterators to the edges incident to i with i as the destination.

source
IndexedGraphs.linearindexMethod
linearindex(g::BipartiteIndexedGraph, v::BipartiteGraphVertex{LR}) where {LR<:LeftorRight}
linearindex(g::BipartiteIndexedGraph, i::Integer, ::Type{LR}) where LR<:LeftorRight

Return the linear index of a vertex, specified either by a BipartiteGraphVertex or by its index and block.

source
IndexedGraphs.outedgesMethod
outedges(g::AbstractIndexedDiGraph, i::Integer)

Return a lazy iterator to the edges outgoing from node i in g.

source
IndexedGraphs.outedgesMethod
outedges(g::BipartiteIndexedGraph, i::Integer)

Return a lazy iterator to the edges incident on a variable i specified by its linear index, with i as the source.

source
IndexedGraphs.outedgesMethod
outedges(g::IndexedGraph, i::Integer)

Return a lazy iterators to the edges incident to i with i as the source.

source
IndexedGraphs.rand_bipartite_graphMethod
rand_bipartite_graph([rng=default_rng()], nleft, nright, ned)

Create a bipartite graph with nleft nodes in the left block, nright nodes in the right block and ned edges taken uniformly at random.

source
IndexedGraphs.rand_bipartite_graphMethod
rand_bipartite_graph([rng=default_rng()], nleft, nright, p)

Create a bipartite graph with nleft nodes in the left block, nright nodes in the right block and edges taken independently with probability p.

source
IndexedGraphs.rand_regular_bipartite_graphMethod
rand_regular_bipartite_graph([rng=default_rng()], nleft, nright, k)

Create a bipartite graph with nleft nodes in the left block, nright nodes in the right block, where all left nodes have degree k.

source
LinearAlgebra.issymmetricMethod
issymmetric(g::IndexedBiDiGraph) -> Bool

Test whether a directed graph is symmetric, i.e. for each directed edge i=>j there also exists the edge j=>i

source