New multi-graph algorithm