The level information will be stored in networkx graph instead of a
matrix