424
|
1 |
import M4a._
|
386
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff
changeset
|
2 |
|
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff
changeset
|
3 |
def count_all_tours_urban(dim: Int) = {
|
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff
changeset
|
4 |
for (i <- (0 until dim).toList;
|
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff
changeset
|
5 |
j <- (0 until dim).toList) yield count_tours(dim, List((i, j)))
|
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff
changeset
|
6 |
}
|
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff
changeset
|
7 |
|
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff
changeset
|
8 |
|
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff
changeset
|
9 |
assert(count_all_tours_urban(1) == List(1))
|
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff
changeset
|
10 |
assert(count_all_tours_urban(2) == List(0, 0, 0, 0))
|
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff
changeset
|
11 |
assert(count_all_tours_urban(3) == List(0, 0, 0, 0, 0, 0, 0, 0, 0))
|
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff
changeset
|
12 |
assert(count_all_tours_urban(4) == List(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0))
|
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff
changeset
|
13 |
|
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff
changeset
|
14 |
|