(String[] args)
| 56 | } |
| 57 | |
| 58 | public static void main(String[] args) { |
| 59 | // example: partition the graph in figure 4 of the KaHIP documentation |
| 60 | int n = 5; |
| 61 | int[] vwgt = new int[0]; |
| 62 | int[] xadj = new int[] {0, 2, 5, 7, 9, 12}; |
| 63 | int[] adjcwgt = new int[0]; |
| 64 | int[] adjncy = new int[] {1, 4, 0, 2, 4, 1, 3, 2, 4, 0, 1, 3}; |
| 65 | int nparts = 2; |
| 66 | double imbalance = 0.4; |
| 67 | boolean suppress_output = false; |
| 68 | int seed = 123456; |
| 69 | int mode = KaHIPWrapper.KAHIP_STRONG; |
| 70 | |
| 71 | KaHIPWrapperResult result = KaHIPWrapper.kaffpa(n, vwgt, xadj, adjcwgt, adjncy, |
| 72 | nparts, imbalance, suppress_output, seed, mode); |
| 73 | |
| 74 | System.out.println("=======\nResult:\n======="); |
| 75 | |
| 76 | System.out.println("edce cut = " + result.getEdgecut()); |
| 77 | System.out.println("Partitions:"); |
| 78 | for (int i=0; i<result.getPart().length; i++) |
| 79 | System.out.println("\tNode " + i + " belongs to block " + result.getPart()[i]); |
| 80 | } |
| 81 | |
| 82 | } |
nothing calls this directly
no test coverage detected