add new method to specify writing of apsp matrix