For each node n:
For each edge (n, n2) e:
n.colors[edgeColor(e)] += 1
For each node n:
n.colors2 = n.colors.copy()
For each edge (n, n2) e:
n.colors2 = mergeSum(n.colors2, n2.colors)
For each edge (n, n2) e:
if n.colors2[edgeColor(e)] == 2 and n2.colors2[edgeColor(e)] == 2:
isolated edge
1 回答
我很确定这会有效,不确定复杂性