Question

# C++ program to implement Kernighan-Lin's partitioning algorithm. The objective is to minimize the number of edges

in the cut and the partitioning should be two-way-even. The number of nodes in the test case would be even.

Input: A text file describing a set of even number of nodes and a set of edges. If there are n nodes, the node indices are continuous integers from 1 to n.

Input file format:

• The first line has two numbers - the number of nodes followed by the number of edges.

• Each of the following lines has two numbers that are indices of two nodes of an edge.

For example:

3 2

1 2

2 3

The input indicates there are three nodes and two edges. Node1 and node 2 are the indices of an edge; node 2 and node 3 are the indices of an edge.

Requirements:

• The initial solution must be partition {1, 2, ...,n/2} and {n/2+1, n/2+2, ..., n}.

• The input filename should be taken as the argument at command line in Linux/UNIX.

• Please submit source code and the executable code for Linux/UNIX.

• The output should be displayed to screen in a self-clear format.

Output:

• Two partitions, each of which is described by the indices of its member nodes.

• Cut set, represented by the edges in the cut, an edge is denoted by a pair of node indices.

### Recently Asked Questions

- Funding for government agancies charged with ensuring public safety is often: Group of answer choices easily secured liberal unnecessary inadequate NFPA 1031 '

- For the circuit shown in Figure 1, (a) Replace the network to the left of terminals B and A by its Thvenin's equivalent circuit. (b) Given that = 100 and V BE

- Please solve them.