Natural physical networks are continuous, three-dimensional objects, like the small mathematical model displayed here.
If you work with strings in your Python scripts and you're writing obscure logic to process them, then you need to look into ...