Generated: July 29, 2004, 07:56:43 A SchemeDoc Manual

Rooster Graph - Fiduccia-Mattheyses bi-partitioning

Jonah Nathaniel Beckford © 2004

Source file: rgraph-alg-part-fidmat.scm
LAML Version 23.00 (December 12, 2003, full)

Table of Contents:
1. Fiduccia-Mattheyses.

Alphabetic index:
GTYPE-partition-fidmat (GTYPE-partition-fidmat graph partition-map gain descriptor-map working-graph working-descriptor-map cost balance weight criterion split-level) Fiduccia-Mattheyses Bipartitioning.
GTYPE-partition-fidmat-check GTYPE-partition-fidmat-check Set to #t to check that the pre-conditions are met in GTYPE-partition-fidmat.
GTYPE-partition-fidmat-debug GTYPE-partition-fidmat-debug Set to #t to print debug statements when running GTYPE-partition-fidmat.

1 Fiduccia-Mattheyses.
Bipartitioning of a graph or hypergraph, minimizing a cost function, subject to a balancing criterion. Is a NP-Complete problem, so this method is a heuristic.

GTYPE-partition-fidmat
Form (GTYPE-partition-fidmat graph partition-map gain descriptor-map working-graph working-descriptor-map cost balance weight criterion split-level)
Description Fiduccia-Mattheyses Bipartitioning. Should never fail to find a bipartition, although it might be a bad partition if the balance criterion is too rigid. You will want to (randomize N) before calling this method, so you can have repeatable partitions.
Precondition working-graph must be of type GTYPE, and have GTYPE-neighbours method. gain must be in the range [-2*DEGREE,2*DEGREE], where DEGREE is the maximum degree of a vertex in graph. When a vertex is moved to another partition, the decrease in cost of the graph must be equal to the gain of the vertex.
Parameters graph The graph you want to partition.
partition-map A vertex property map that is has as its values either #t or #f. These are the two partitions a cell might belong to. This is the main output of the algorithm.
gain A vertex property getter. Must calculate the gain of a vertex. See section 1.2 of Design and Implementation of the Fiduccia-Mattheyses Heuristic for VLSI Netlist Partitioning. Basically, the gain is positive if it reduces the solution cost if the cell switched partitions, and negative if it increases the solution cost. And the magnitude of the gain *must* correspond to the change in solution cost. You can make sure by calling (set! GTYPE-partition-fidmat-check #t) before using (partition-fm ...).
descriptor-map A vertex property map that has as its values the edge descriptors for working-graph.
working-graph An empty graph that has quick edge(u,v) access, and memory flexibility to handle the same number of vertices as graph. O(E) = O(V).
working-descriptor-map A vertex property map on working-graph that has as its values the vertex descriptors for graph. It should, but is not required to, be an internal property map, since the working-graph is clear!ed repeatedly.
cost Procedure of 0-arg that calculates the cost of the current partition for 'cells'. This solution cost is usually the edge cost, although it may be anything.
balance Procedure of 3 arguments (weight n#f n#t). How much more do you have in the larger partition compared to the smaller partition? The result can range as an integer from 0 to 100, with 0 being perfectly balanced and 100 being perfectly imbalanced. The argument weight is the desired weighting of the partition. For example, if weight==(cons 3 7), then the perfect balance is when 30% of the cost is for those within partition #f, while 70% are within partition #t. Normally you would want '(1 . 1) for an equal bipartition. You can, and should, pass in the number in partition #f and the number in partition #t by using n#f and n#t. If you want to be very fast, set them to non-negative integers; otherwise, leave them #f otherwise.
weight A pair in the form (X . Y). If X=3 and Y=7, then perfectly balanced would mean that 3/10 of the cost is in partition #f, and 7/10 of the cost is in partition #t.
criterion A non-negative integer that is the maximum that the balance may be. If you use the range [0..100] for balance, then the range for criterion would be [0..100], and you might use criterion=35 to allow significant imbalances.
split-level 0 = Exit after first iteration (quickest).
1 = Exit when cost does not decrease by at least one-half.
2 = Exit when cost does not change.
partition-map Property map for the 'partition' boolean property.
See also properties Rooster Graph Properties

GTYPE-partition-fidmat-check
Form GTYPE-partition-fidmat-check
Description Set to #t to check that the pre-conditions are met in GTYPE-partition-fidmat. Whenever a vertex moves partitions, the decrease in cost must be equal to the gain. Also, the gain must always be in the range [-2*DEGREE,2*DEGREE], where DEGREE is the maximum degree of any vertex. This takes a lot of CPU time to check, so only do this when you are debugging and verifying that your cost and gain functions correspond.

GTYPE-partition-fidmat-debug
Form GTYPE-partition-fidmat-debug
Description Set to #t to print debug statements when running GTYPE-partition-fidmat.


Generated: July 29, 2004, 07:56:43
Generated by LAML SchemeDoc .