Also: - add loop detection before creating an edge between two nodes, to avoid creating invalid graphs.
Also: