C program which prints every shortest path in a graph (even the same-weight ones)