Did I find the right examples for you? yes no

All Samples(10)  |  Call(10)  |  Derive(0)  |  Import(0)
```Computes the adjacency distance between two permutations.

This metric counts the number of times a pair i,j of jobs is
adjacent in both p and p'. If n_adj is this quantity then

[1] Reeves, Colin R. Landscapes, Operators and Heuristic search, Annals
of Operational Research, 86, pp 473-490. (1999)

(more...)
```

```
assert p.get_precedence_distance(q) == q.get_precedence_distance(p)
assert p.get_positional_distance(q) == p.get_positional_distance(q)
p = Permutation([0, 1, 2, 3])
q = Permutation([3, 2, 1, 0])
assert p.get_precedence_distance(q) == 6
```
```    p = Permutation([0, 3, 1, 2, 4])
q = Permutation.josephus(4, 5, 2)
raises(ValueError, lambda: p.get_positional_distance(Permutation([])))
```

```
assert p.get_precedence_distance(q) == q.get_precedence_distance(p)
assert p.get_positional_distance(q) == p.get_positional_distance(q)
p = Permutation([0, 1, 2, 3])
q = Permutation([3, 2, 1, 0])
assert p.get_precedence_distance(q) == 6
```    p = Permutation([0, 3, 1, 2, 4])