printGraph and printConnections ordered