I want to compare two different partitions of a set consisting of $n$ elements: ${1,2,3,...,n}$. How can I count the number of elements that are in different subsets when comparing partition 1 with partition 2?
Examples with $n=6$
Partition 1: $\{\{1,2,3\},\{4,5,6\}\}$, partition 2: $\{\{1,2,4\},\{3,5,6\}\}$ should yield $2$ since the elements $3$ and $4$ are in different subset.
Partition 1: $\{\{1,2,3\},\{4,5,6\}\}$, partition 2: $\{\{1,2\},\{3\},\{4,5,6\}\}$ should yield $1$ since the element $3$ is in a different subset.
Partition 1: $\{\{1,2,3\},\{4,5,6\}\}$, partition 2: $\{\{1,2,3,4,5,6\}\}$ should yield $3$ since the elements $4,5,6$ are in different subsets.
Background: I want to compare two different community partitions of a network. I would like to know how many nodes I have to "move" to a different community to get from one partition to the other. In this picture you can see a possible community partition (the communities are color-coded, i.e. nodes with the same color belong to the same community).
This problem can be transformed into an assignment problem.
Solution: https://cstheory.stackexchange.com/questions/6569/edit-distance-between-two-partitions