Cospans and spans of graphs: a categorical algebra for the sequential and parallel composition of discrete systems · wovepaper