visualiziation for a graph theory problem