Adding methods to build graphs from their representations.