Algorithm to calculate a Petri Net's Case Graph