-
-
Notifications
You must be signed in to change notification settings - Fork 299
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PY: graph_tools #32
Comments
@ZacCranko when you have the time, I think you have a better idea about what is in the Julia library already and what is available on the Python side, but not the Julia side. |
Given that we |
The only particularly special thing that To address this issue I could just implement this particular algorithm. Additionally, what are your thoughts on a move to |
I also saw LightGraphs recently and am definitely in favor of moving to it if we can. If we can just add methods to cover all the different properties defined in the python version of mc tools I don't think we also need to do the graphs. We'll let the developers of the LightGraphs handle that 😏 |
Totally agree, we don't need to become a graphing library in addition to a computational economics library. I've been chatting with @sbromberger, just waiting on a couple new algorithms to be pushed in |
Hi all, just wanted to stick my nose in. I'm working on retooling BFS and DFS in LightGraphs. This will give us (hopfeully very fast) cycle detection and connected components (with both strong and weak for DiGraphs). I've currently got DAGs for the traversals working, so we've got a nice traversal tree. Let me know if you need any other base functionality. I'm gratefully accepting PRs to code so if you wind up developing some great algorithms using LightGraphs, please share them! |
Just following up - if you want to check out the "bfsdfs" branch of LightGraphs.jl, it'll have connectivity, traversal DAGs, and some other neat stuff. Comments appreciated. |
Thanks for the heads up. I'm looking forward to our move to LightGraphs. @ZacCranko is handling this issue so I look forward to his report. |
Hi @sbromberger As @spencerlyon2 and @ZacCranko discuss, it would be great if |
Hm. This is outside my area of expertise, unfortunately. However, perhaps the following can be used as a starting point? I've implemented cycle detection ( I'll look into periodicity today or tomorrow. |
@sbromberger I'll help you get this happening, but I needed to be asleep 40 minutes ago |
@ZacCranko totally on your schedule :) Have a good night. |
@ZacCranko @sbromberger I'm starting to look at this right now. |
@sbromberger I know almost nothing about graph theory, so I apologize in advance for my ignorance. However, I did notice something. The
Is there a way we can make this possible? That would be great because we use the |
@spencerlyon2 yes - I spoke with @ZacCranko about this this morning (my time). I don't know of any reason off the top of my head that self-loops wouldn't work, but there are a couple of changes to graphs.jl and digraphs.jl (specifically in @ZacCranko said he'd be testing this and will report back any unusual behavior. |
Oh ok great. I didn't realize you guys were already working on this. I'll leave it to the experts and move on to something else then :) p.s.: where are you located (i.e. what is "my time")? |
Normally it's US Pacific Time (currently UTC-7) but until middle of next month I'm in Bogotá, so UTC-5. |
@ZacCranko @spencerlyon2 also - a good way of doing this might be to create a new concrete type
and define/override the appropriate functions/methods there. That way you keep the self-loop stuff independent of the regular stuff, and if it turns out it works, we can incorporate it easily. |
In fact, no support for digraphs with self-loops is not an issue for our purpose.
|
Thanks for that @oyamad, I'll be looking at this today. |
Confirmed that this appears to be working as intended in LightGraphs (you'll need the
Also note that |
Hi @sbromberger: I was playing with your I was considering the digraph in Figure 8 on page 12 in "Graph-Theoretic Analysis of Finite Markov Chains" by J. P. Jarvis and D. R. Shier, which is clearly strongly connected, but
I wonder if I am missing anything. Just in case, >>> import networkx as nx
>>> nodes = list(range(1, 7))
>>> edges = [(1, 3), (3, 4), (4, 2), (2, 1), (3, 5), (5, 6), (6, 4)]
>>> G = nx.DiGraph()
>>> G.add_nodes_from(nodes)
>>> G.add_edges_from(edges)
>>> G.edges()
[(1, 3), (2, 1), (3, 4), (3, 5), (4, 2), (5, 6), (6, 4)]
>>> nx.number_strongly_connected_components(G)
1
>>> list(nx.strongly_connected_components(G))
[[1, 3, 5, 6, 4, 2]] ( |
@oyamad almost definitely a bug. Could you open an issue in lightgraphs and I'll look into it next week? Thanks. |
@sbromberger Sure, copied. |
@oyamad That pdf is a great resource, I'm going to be coding up all the examples to use for tests in |
Please checkout the latest Bottom line: this was actually a bug in the Graphs.jl code (which LightGraphs "appropriated" :) - I filed a PR there as well. |
Hi @ZacCranko
|
@ZacCranko is this now complete? |
Yep. For now. |
Just FYI - with @ZacCranko's help, we've implemented support for self-loops in LightGraphs, so the earlier concerns about having to manipulate the adjacency matrices might now be moot. Please have a look at the latest master branch and let me know (via issues in LightGraphs) if you run into any problems. @ZacCranko - thanks again. Your work has definitely improved the quality and feature set of LightGraphs! |
Don't have a julia version of the graph_tools module
The text was updated successfully, but these errors were encountered: