Live data from Hacker News

NetworkX – Network Analysis in Python

networkx.org

61–65 of 65 posts

Re: NetworkX – Network Analysis in Python

#61
post #40

I've used recently the networkx algorithm to find Hamiltonian cycles in a graph, in order to generate a Secret Santa with constraints (couples don't send gifts to each other, and people don't give to the same person as last year), it works great even though the problem is NP-complete, since my number of participants is very low. I've tried the same in Rust with petgraph which resembles networkx, but it doesn't have t…

Is this similar to graph colouring?

They are distinct problems, because if you have a graph with a Hamiltonian cycle inside, you can add as many edges as you want, the cycle will always be there, but some N-colouring solutions might break.

They are both NP-complete though.

Re: NetworkX – Network Analysis in Python

#62
post #54

Back in the days I’ve discovered NetworkX and Gephi in a Coursera course and was really surprised about how simple it managed to represent visually such a hard problem (I’ve never been able to find this course again it started with Erdos number that’s the only thing I remember)

Ah I was about to ask what course this was. If you ever find it again I'd love to hear what it was.

Re: NetworkX – Network Analysis in Python

#63
NetworkX's documentation is the source of one of the most surreal but true sentences ever written (with just a slight alteration) [0]:

  A lobster is a tree that reduces to a caterpillar when pruning all leaves.
[0] https://networkx.org/documentation/latest/reference/generate...

Re: NetworkX – Network Analysis in Python

#64
post #59
post #39

Earlier quoted context omitted.

Good question. Are you talking about generation, transmission or distribution? From my experience as an electrical engineer working for a distribution network: * The traditional approach to network planning: take your edge cases (e.g. winter peak demand), and apply your engineering knowledge and intuition to manually study the most onerous outage conditions. * This will vary on where you are in the world, but network…

I meant transmission but I’m interested in both. Can you say a bit more about built in slack? You mean like Distribution Automation switches to backfeed an area? This has felt sort of rare to me

The security of supply standards are conservative. Good for reliability, but this comes at a price. This report goes in to more detail: https://www.dcode.org.uk/assets/uploads/IC_Report_exec_summa...

~20 years ago, the regulator introduced an incentive scheme to reduce customer interruptions and minutes lost. This resulted in heavy investment in network automation in the UK.

Re: NetworkX – Network Analysis in Python

#65

Been a few years since I put NetworkX through its paces, but the several times I have tried it, found remarkably weak support for graph layout and display. NetworkX analytic routines may be strong, but attractively displaying graph-structured problems remarkably more interactive and attractive via d3.js, GraphViz, etc. At least for my problems, communicating graph structures, and having nodes and edges that represent…

You may like my Netgraph library [1], which is a Python library that aims to complement networkx, igraph, and graph-tool with publication-quality visualisations.

Netgraph implements numerous node layout algorithms and several edge routing routines. Uniquely among Python alternatives, it handles networks with multiple components gracefully (which otherwise break most node layout routines), and it post-processes the output of the node layout and edge routing algorithms with several heuristics to increase the interpretability of the visualisation (reduction of overlaps between nodes, edges, and labels; edge crossing minimisation and edge unbundling where applicable). The highly customisable plots are created using Matplotlib, and the resulting Matplotlib objects are exposed in an easily queryable format such that they can be further manipulated and/or animated using standard Matplotlib syntax. Finally, Netgraph also supports interactive changes: with the InteractiveGraph class, nodes and edges can be positioned using the mouse, and the EditableGraph class additionally supports insertion and deletion of nodes and edges as well as their (re-)labelling through standard text-entry.

[1] https://github.com/paulbrodersen/netgraph

Post reply on HN