fixes #65 : correct advanced network mode for cases with more than 1 components

This should fix errors in cases where the graph contains more than 1 components.

With these changes, here are the data files and results for Mario Hofmann's problem: https://gist.github.com/tanmaykm/9683189