Edge contraction for directed, edge-labeled graphs
Minimal graph signature for edge contraction algorithm
contract p g will perform edge contraction on the graph g. The edges for which the property p holds/is true will get contracted: The resulting graph will not have these edges; the start- and end-node of these edges will get united.
contract p g
g
p