Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions docs/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ Because `SimpleWeighted(Di)Graph`s are stored in sparse matrices, they have two

- Zero-weight edges are discarded by `add_edge!`. A possible workaround is to [set a very small weight instead](https://stackoverflow.com/questions/48977068/how-to-add-free-edge-to-graph-in-lightgraphs-julia/48994712#48994712).

In additions, self-loops are not supported.

## Alternatives

If your graphs have more than just edge weights to store, take a look at [MetaGraphsNext.jl](https://github.com/JuliaGraphs/MetaGraphsNext.jl) or [MetaGraphs.jl](https://github.com/JuliaGraphs/MetaGraphs.jl) for more complex formats.
2 changes: 1 addition & 1 deletion src/SimpleWeightedGraphs.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""
SimpleWeightedGraphs

A package for graphs with edge weights, stored as sparse adjacency matrices.
A package for graphs with edge weights and no self-loops, stored as sparse adjacency matrices.
"""
module SimpleWeightedGraphs

Expand Down
1 change: 1 addition & 0 deletions src/simpleweighteddigraph.jl
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ SimpleWeightedDiGraph(adjmx; permute) # from adjacency matrix, possibly transpo
SimpleWeightedDiGraph(sources, destinations, weights) # from list of edges
```
Use `methods(SimpleWeightedDiGraph)` for the full list of constructors.
When building a new graph from a list of edges, be aware that repeating `(src, dst)` pairs may lead to undefined behavior (e.g. due to floating point errors during weight addition).
"""
mutable struct SimpleWeightedDiGraph{T<:Integer,U<:Real} <: AbstractSimpleWeightedGraph{T,U}
weights::SparseMatrixCSC{U,T}
Expand Down
1 change: 1 addition & 0 deletions src/simpleweightedgraph.jl
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ SimpleWeightedGraph(adjmx) # from adjacency matrix
SimpleWeightedGraph(sources, destinations, weights) # from list of edges
```
Use `methods(SimpleWeightedGraph)` for the full list of constructors.
When building a new graph from a list of edges, be aware that repeating `(src, dst)` pairs may lead to undefined behavior (e.g. due to floating point errors during weight addition).
"""
mutable struct SimpleWeightedGraph{T<:Integer,U<:Real} <: AbstractSimpleWeightedGraph{T,U}
weights::SparseMatrixCSC{U,T}
Expand Down