rs59 / q2

0 stars 0 forks source link

Determine and document how to run the program #3

Open rs59 opened 1 year ago

rs59 commented 1 year ago

Requirements:

rs59 commented 1 year ago

USER MANUAL: 2023partition

A readme USER MANUAL text file (written in plain ASCII) describing how to run the program

Running the program:

2023partition nthreads npartitions maxdeviation inputfile outputfile ex. 2023partition 2 3 1.05 input.gv output.gv

nthreads: number of threads, 1 or greater (1 if sequential, more if parallelizable) npartitions: number of partitions desired in the output graph maxdeviation: maximum deviation of the output partition size, expressed as a float value greater than 1.00. This value is multplied by the ideal partition size (sum_weights/npartitions) to create an upper bound for the partition size inputfile: input file for graph input (see format info below) outputfile: output file for graph output (see format info below)

Program output:

[301,305,296]

If the program run is successful, the size (sum of vertex weights) of each partition.

Unable to split graph: ERROR

If the program run is unsuccessful, a message indicating failure and the error reason.

Input file

The program reads in source files with inputs in the format V(n1,4) V(n2,3) .... E(n1,n2,6) where:

Example input file:

#define _STR(x) #x
#define STR(x) _STR(x)

#define V(A,B) A [label=B];
#define E(A,B,C) A -- B [label="  "+STR(C)];

graph G {

    V(n1,4)
    V(n2,3)
    V(n3,2)
    V(n4,1)

    E(n1,n3,6)
    E(n3,n2,7)
    E(n1,n4,9)
    E(n2,n4,4)
}

Simple rendering (node weight in brackets, edge weight between dashes):

[1] --4-- [3] --7-- [2] --6-- [4]
 \_____________9______________/

Output file

The program outputs source files with in the format x1 subgraph c1 { V(n1,4) V(n4,1) } subgraph c2 { V(n2,3) V(n3,2) } .... E(n1,n2,6) x2 where:

Example output file:

#define _STR(x) #x
#define STR(x) _STR(x)

#define V(A,B) A [label=B];
#define E(A,B,C) A -- B [label="  "+STR(C)];

graph G {

    subgraph cluster1 {
      V(n1,4)
      V(n4,1)
    }

    subgraph cluster2 {
      V(n2,3)
      V(n3,2)
    }

    E(n1,n3,6)
    E(n3,n2,7)
    E(n1,n4,9)
    E(n2,n4,4)
}

Simple rendering (node weight in brackets, edge weight between dashes, split marked using / character):

     [3] --7-- [2]
     |           |
//// 4 ///////// 6 ////
     |           |
     [1] --9-- [4]

Compile and run the program

rs59 commented 1 year ago

Creating a C++ notebook: https://mybinder.org/v2/gh/jupyter-xeus/xwidgets/stable?filepath=notebooks/xwidgets.ipynb