- Algorithms use an
**adjacency matrix**w to represent graphs, where

Negative weights are allowed, but not negative cycles.

- Algorithms output a
**distance matrix**D, where*d*_{ij}is the weight of the shortest path from i to j.For example, .

- Algorithms may also output
**predecessor matrix**, where is NIL if either i=j or there is no path from i to j; otherwise, is the predecessor of j on a shortest path from i.

- From the predecessor matrix ,
we can derive the
**predecessor subgraphs**for each vertex i V as