In this chapter, we will primarily use the NetworkX package for working with trees and networks. This package can be installed using your favorite package manager, such as pip:
python3.8 -m pip install networkx
We usually import this under the alias nx, following the conventions established in the official NetworkX documentation, using the following import statement:
import networkx as nx
The code for this chapter can be found in the Chapter 05 folder of the GitHub repository at https://github.com/PacktPublishing/Applying-Math-with-Python/tree/master/Chapter%2005.
Check out the following video to see the Code in Action: https://bit.ly/2WJQt4p.