Live data from Hacker News

NetworkX 3.0 - create, manipulate, and study complex networks in Python

networkx.org

21–30 of 58 posts

Re: NetworkX 3.0 - create, manipulate, and study complex networks in Python

#21
NetworkX is my go-to library for helping people get started with open source (like mentoring new devs that want git practice, practice working in a large codebase, etc.). I feel it is laid out in an easy to understand way and all the main parts do one clear thing that can be understood even with only a basic knowledge of graph theory. It also hits the sweet spot of being an obviously useful and widely used package, but without the army of devs working on it, so there is still a lot of low-hanging fruit for tangible contributions.

I compare it to something like Django or scikit-learn, which seem insanely dense and difficult to understand even as an experienced dev, and there are so many people working on them that it's hard to find easy but non-trivial contributions for a beginner to make.

Re: NetworkX 3.0 - create, manipulate, and study complex networks in Python

#23

By the way if you want to explore network science but don't really know where to start, consider Gephi (currently being refactored, and just updated a few days ago) or Cytoscape (if you're more drawn to bioinformatics). Both make it easy to load/generate standard datasets, import tabular data, and have a good selection of plugins. It's easy to kick stuff out to either from NetworkX using /gefx or graphml, and you'll…

I've had a lot of luck with Gephi for fairly complex graphs (~10000 nodes and edges), in particular it has some very powerful layout algorithms. It can be very helpful to have immediate visual feedback when untangling something like that. Nice to see that development is ongoing, the GUI used to feel a bit clunky but 0.10 seems a lot better!

Re: NetworkX 3.0 - create, manipulate, and study complex networks in Python

#24
I use NetworkX rather unusually to parse Graphviz dot specification files in my devops pipeline tool, mazzle.

They allow me to define infrastructure build instructions as a dot file that looks similar to this. It's similar to an advanced makefile.

This segment of the infrastructure specification sets a dependency on the bastion box, the vault AMI (Amazon Machine Image) and web server provisioned by terraform on the source AMI. Then it sets a dependency of uploading nodejs to the repository server and a dependency on dpkg scan packages. It also tells machines to join themselves to a Kubernetes cluster.

  digraph G {
    label="pipeline";
    rankdir=TB;



  "packer/source-ami*" -> { "terraform/bastion";
                          "packer/vault-ami*";
                          "terraform/web"
                        }

  "terraform/bastion" -> "@repository-upload/nodejs_12.13.1_amd64"
  "terraform/repository" -> "@repository-upload/nodejs_12.13.1_amd64"

  "@repository-upload/nodejs_12.13.1_amd64" -> "@shell/dpkg-scanpackages"

  "terraform/web" -> "@ansible/kubernetes-join";
  "terraform/bastion" -> "@ansible/kubernetes-join";
  "terraform/services" -> "@ansible/kubernetes-join";
  "@ansible/kubernetes" -> "@ansible/kubernetes-join";

   ...

   }
Graph formats are really flexible and compact and I would like to see them used for more things.

A topological search solves many problems.

https://devops-pipeline.com/

Re: NetworkX 3.0 - create, manipulate, and study complex networks in Python

#25
For my telco job, I whipped up a shortest path routing proof of concept using NetworkX in a couple hours, right after stumbling on it, with my rudimentary Python scripting skills. The sort of extremely productive library that makes one feel heroic !

Re: NetworkX 3.0 - create, manipulate, and study complex networks in Python

#26

Earlier quoted context omitted.

> I kind of assumed people would know Not everyone writes Python, and not all Python programmers have heard of this particular library.

Not all people are programmers and not all people have heard of programming. This post is catered to an audience that probably knows what NetworkX is.

I have written Python for 10 years on and off and have never come across it, or if I did I had forgotten about it.

Re: NetworkX 3.0 - create, manipulate, and study complex networks in Python

#28
I just started using NetworkX a few days ago and was trying to figure out a way to find all paths in a DAG from a source node to a destination node, with the requirement that no path is a superpath of any other path.

I ended up writing my own approach that iterates through all pairs of paths but have been bothered since then that I couldn’t find a function in NetworkX to do this; I’m sure it probably exists but I don’t know the right terminology to search for it. Anyone know what this function might be called?

Re: NetworkX 3.0 - create, manipulate, and study complex networks in Python

#29
post #21

NetworkX is my go-to library for helping people get started with open source (like mentoring new devs that want git practice, practice working in a large codebase, etc.). I feel it is laid out in an easy to understand way and all the main parts do one clear thing that can be understood even with only a basic knowledge of graph theory. It also hits the sweet spot of being an obviously useful and widely used package, b…

Do you have any recommendations on how to get started? I have been using open source for around 10 years and always wanted to contribute. I am a confident python scripter and have used NetworkX in the past for various academic projects, however I have no idea how to get started as a beginner dev and contribute to open issues and bugs. Heck, I don't even know how large codebases are structured! Any hints or recommendation are welcome! :D

Re: NetworkX 3.0 - create, manipulate, and study complex networks in Python

#30

I just started using NetworkX a few days ago and was trying to figure out a way to find all paths in a DAG from a source node to a destination node, with the requirement that no path is a superpath of any other path. I ended up writing my own approach that iterates through all pairs of paths but have been bothered since then that I couldn’t find a function in NetworkX to do this; I’m sure it probably exists but I don…

I am trying to imagine how it is even possible for this to happen in a DAG. One path from A to B cannot be a strict subset of another (because this implies a cycle) - I unless you mean something else by "superpath".
Post reply on HN