New input utilities for the implementation using Boost undirected graph. Main cleaned up.