Introduction to Testing: MatchingTesting for the matching part of the coarsening in Walshaws Multilevel algorithm was important to ensure everything works as it should (or as close as can be). Testing was carried out by simply inputting the chaco files of some familiar graphs, and reading the output. To check the output, I would work through the algorithm by hand on each graph to ensure (and see) which matches are made and where.
Measuring SuccessAt this stage, a success would be if the program output a number of matches that is feasible. That is to say, the matches meet the criteria that:
- no vertex is shared with another matching
- edges can only be matched once
- the number of matchings is maximal
Test Subjects2dSquare - a simple 4 vertex graph with 4 edges, each edge being the same size, with the outcome being a square. The expected output would be 2 matchings*.
9square - simlar to 2dsquare, except a grid of 9 squares, with 16 vertices and 24 edges. The expected output is 8 matchings*.
own - my own graph, shown in previous posts, a disjoint graph: 1) 6vertices 6 edges, 2) 4 vertices 4 edges. This has been used to test previous implementations and has worked well at providing an "irregular" graph. Expected 5 matchings*.
1ma** - a graph taken from [1], 6 vertices 6 edges
2ma** - as above, taken from [1], 6 vertices 7 edges
3ma** - again, as above, taken from [1], 5 vertices 6 edges
*previous to the tests, I went through each graph as the algorithm would, and noted down which matchings should be made
**taken from [1], these graphs proved useful regarding my research into matching and I expect them to be as useful as test subjects - please note not all research for matching was through wikipedia
Results2dsquare.graph - 2 matchings
9square.graph - 8 matchings
own.graph - 5 matchings
ma1.graph - 1 matching
ma2.graph - 3 matchings
ma3.graph - 2 matchings
ConclusionsThe results show that the matchings made are feasible and realistic, however, they are not always maximal, for example, ma1.graph recieved 1 matching, where it could have 2 matchings. This is due to the way the program looks through edges (linearly), which can and should be changed.
For the purpose of continuing with more important aspects of the multilevel paradigm, this implementation will continue without changes.
Complexity wise, this needs to be checked over by my supervisor, but should be O(|V| . |E|).
References[1] https://secure.wikimedia.org/wikipedia/en/wiki/File:Maximal-matching.svg , accessed 05.11.10, Author: Miym