Step 1: Open and read each line of the data file. Considering some possibilities are not an integer, enlarge all the possibilities to integers.

Step 2: Search in the list of edges. Classify them into different separate graphs.