juliagraphs / graphs.jl Goto Github PK
View Code? Open in Web Editor NEWAn optimized graphs package for the Julia programming language
Home Page: http://juliagraphs.org/Graphs.jl/
License: Other
An optimized graphs package for the Julia programming language
Home Page: http://juliagraphs.org/Graphs.jl/
License: Other
This issue is used to trigger TagBot; feel free to unsubscribe.
If you haven't already, you should update your TagBot.yml
to include issue comment triggers.
Please see this post on Discourse for instructions and more details.
If you'd like for me to do this for you, comment TagBot fix
on this issue.
I'll open a PR within a few hours, please be patient!
The link https://juliagraphs.org/Graphs.jl/dev/ is broken
It's a pity to lose all the information contained in the open and closed issues of the old repo.
Run this,
using LightGraphs, MetaGraphs, SimpleGraphs
g = MetaDiGraph()
add_vertex!(g.graph)
add_edge!(g,1,1)
and then make a new session swapping LightGraphs for Graphs.jl
you should get the following error:
ERROR: LoadError: MethodError: no method matching add_vertex!(::LightGraphs.SimpleGraphs.SimpleDiGraph{Int64})
Closest candidates are:
add_vertex!(::SimpleDiGraph{T}) where T at /home/caseykneale/.julia/packages/Graphs/Mih78/src/SimpleGraphs/simpledigraph.jl:449
add_vertex!(::Graphs.SimpleGraphs.SimpleGraph{T}) where T at /home/caseykneale/.julia/packages/Graphs/Mih78/src/SimpleGraphs/simplegraph.jl:526
At the moment, a_star
returns a list of edges, while dijkstra_shortest_paths
returns a custom state object. Would it make sense to have homogeneous outputs, at least for the single-source case?
I understand why the Graphs.jl interface doesn't require the possibility of graph modification. However, wouldn't it be nice to specify at least the desired names add/rem_vertex/edge!
in case people decide to implement them?
This could help standardize algorithms that include graph operations such as contractions (see #79)
This is a repost of this issue on the old repo.
Hi,
This is a follow up of this discussion.
Is there a way to efficiently find shortest paths in a directed graph while ignoring the direction of the edges ? (so without casting to a directed graph)
R seems to have an "undirected" mode for this.
Having thought more on this, better than a keyword in functions, it would be practical to have a new graph type that would be a wrapper around a directed graph, with redefinition of accessers to make it an undirected graph (a sort of graph view). This would avoid the heavy conversion to an undirected graph.
I saw this once on my mac running single threaded
Testing Running tests...
Parallel.Closeness: Test Failed at /Users/viral/.julia/packages/Graphs/mjncd/test/parallel/centrality/closeness.jl:14
Expression: tz ≈ [0.75, 0.4444444444444444, 0.3333333333333333, 0.0]
Evaluated: [0.75, 0.4444444444444444, 0.3333333333333333, NaN] ≈ [0.75, 0.4444444444444444, 0.3333333333333333, 0.0]
Stacktrace:
[1] macro expansion
@ ~/.julia/packages/Graphs/mjncd/test/parallel/centrality/closeness.jl:14 [inlined]
[2] macro expansion
@ /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.6/Test/src/Test.jl:1151 [inlined]
[3] top-level scope
@ ~/.julia/packages/Graphs/mjncd/test/parallel/centrality/closeness.jl:2
And see it in CI too: https://github.com/JuliaGraphs/Graphs.jl/runs/3931288326
This is a repost of this issue, I think it deserves discussion on whether we should return edges instead of vertices.
Summary :
start=[1,1,2,2,2,3,4,4,5,5,7,7,8,8,9,9,10,10,12,12,1,2,3]
destination=[2,4,4,5,3,5,7,8,7,8,9,10,9,10,11,12,12,13,13,11,11,12,13]
graph_s=SimpleWeightedGraph(start,destination,collect(1:23))
bi_components= biconnected_components(graph_s)
graph_s
has 23 edges, but only 19 are returned in the unique biconnected component.
etienneINSA : The error is here : the edge is added only if
state.low[v] > state.depth[w]
, whereas it should be always added to the stack. I can make a PR, but I have an interrogation: Why do we return the biconnected components by their edges? As the subgraphs are induced, this is more easily defined by the vertices. Is there a good reason to do that, or would it be too breaking to change this behavior?
We may be able to accelerate some of the kernels within Graphs.jl using https://github.com/JuliaSparse/SuiteSparseGraphBLAS.jl.
cc @wimmerer
Hi graphers! (graphistes?) Thank you for your efforts in migrating, maintaining, and updating this package, which so many of us find useful.
As a very minor contribution, here are some suggestions for a refreshed icon.
I noticed an oddity with the current icon. For some reason it's slightly transparent, which explains the subdued appearance when used with GitHub's Dark Mode.
The current icon also uses the OG Julia duotone colour design, which was replaced by single colours sometime around v1.2.
At the moment, there is no function to calculate the edge betweenness centrality of a graph.
I have an implementation for undirected/unweighted graphs, at least.
Should I do a PR for this?
The current documentation has many sections in the menu on the left, but hardly any subsections. I feel like this doesn't help navigation, and I would prefer a more hierarchical approach (like the one from networkx. Does anyone agree?
For an edge operation f
, define both f(g, src(e), dst(e))
and f(g, e)
on abstract graphs
The way the squash
is currently implemented is by either calling SimpleGraph{T}(g)
or SimpleDiGraph{T}(g)
for some integer type T
. This fails if g
is a subtype of AbstractGraph
for which these functions are not implemented. There are multiple ways to solve this:
squash
to SimpleGraph
and SimpleDiGraph
and leave the implementation of that function for other graph types open.SimpleGraph{T}(g)
or SimpleDiGraph{T}(g)
work for for any kind of g::AbstractGraph
.SomeGraph <: AbstractGraph
implement a constructor SomeGraph{T}(g)
and adjust squash
accordingly.In my opinion, 1. is the way to go. 2. could lead to some information (such as metadata) being thrown away by squash
which is probably not what the user wants. 3. would make the interface more complicated and would make existing packages not correspond to the interface anymore.
Issue previously open at #1518 for LightGraphs.jl.
The is_cyclic
function in LightGraphs.jl works well for directed graphs but for undirected graphs returns true
for any nonempty graph. The usual definition for undirected graphs is that cycles don't contain repeated links, so 1->2->1 is not considered a cycle (absent multiple edges.)
Useful for me because I want a function that will test whether an (undirected) network is a tree and easiest way to check that is to confirm the graph is acyclic+connected
In traversals we use dir=[:in,:out]
to tell functions to use in or out neighbors. We should probably have a more systematic approach based on a type like ReverseGraph{G} <: AbstractGraph
. This came up in #36 where you have a symmetry in the algorithm that is invariant to the direction.
A parallel BFS non-deterministic issue in #9
https://github.com/JuliaGraphs/Graphs.jl/pull/9/checks?check_run_id=3932016414#step:6:227
Trace says this is where the test fails: https://github.com/JuliaGraphs/Graphs.jl/blob/master/src/Parallel/traversals/gdistances.jl#L67
The test failed in the parallel gdistances test.
It would be nice to have support for graph minors, at list for SimpleGraph
s and possibly even in the interface by defining something like contract_edge!(g, s, d)
Hey!
There has been some talk recently about adding better support for graph metadata, so here's an issue to centralize our discussions. First of all, here are the packages that I'm aware of that deal with vertex- & edge-level attributes:
One idea would be to design a common interface extending AbstractGraph
to work with metadata. I'm aware that the four packages above are very different, and that the case of edge weights probably deserves special treatment. On the other hand, agreeing on a common set of names for functions would bring clear benefits:
As food for thought, here are a few past discussions on this topic:
What is your take on this?
If I interpret the logs correctly, it looks like 1.3 isn't supported anymore:
https://github.com/JuliaPlots/Makie.jl/runs/4753606377?check_suite_focus=true#step:6:284
Was this on purpose?
Currently the period
functions seems to work only for SimpleDiGraph
. It should either be restricted to that type or implemented in a way that works with other directed AbstractGraph
.
How to reproduce:
julia> using Graphs, SimpleWeightedGraphs
julia> g = cycle_digraph(4)
{4, 4} directed simple Int64 graph
julia> gw = SimpleWeightedDiGraph(g)
{4, 4} directed simple Int64 graph with Float64 weights
julia> period(g)
4
julia> period(gw)
ERROR: MethodError: no method matching difference(::SimpleWeightedDiGraph{Int64, Float64}, ::SimpleDiGraph{Int64})
Closest candidates are:
difference(::T, ::T) where T<:AbstractGraph at ~/.julia/dev/Graphs/src/operators.jl:196
Stacktrace:
[1] period(::Type{IsDirected{SimpleWeightedDiGraph{Int64, Float64}}}, g::SimpleWeightedDiGraph{Int64, Float64})
@ Graphs ~/.julia/dev/Graphs/src/connectivity.jl:503
[2] period(g::SimpleWeightedDiGraph{Int64, Float64})
@ Graphs ~/.julia/packages/SimpleTraits/l1ZsK/src/SimpleTraits.jl:331
[3] top-level scope
@ REPL[20]:1
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.