Add APSP matrix output functions