Example #1
0
void graph_gen(graph_t* g, char* filename, char* graph_type) {

    if (strcmp(graph_type, "snap") == 0) {
        read_SNAP_graph(g, filename);
    } else if (strcmp(graph_type, "dimacs") == 0) {
        read_DIMACS_graph(g, filename);
    } else if (strcmp(graph_type, "metis") == 0) {
        read_METIS_graph(g, filename);
    } else if (strcmp(graph_type, "gml") == 0) {
        read_GML_graph(g, filename);
    } else if (strcmp(graph_type, "rand") == 0) {
        gen_random_graph(g, filename);
    } else if (strcmp(graph_type, "rmat") == 0) {
        gen_RMAT_graph(g, filename);
    } else if (strcmp(graph_type, "sqm") == 0) {
        gen_sqmesh_graph(g, filename);
    } else if (strcmp(graph_type, "lm") == 0) {
        gen_lmesh_graph(g, filename);
    } else {
        fprintf(stderr, "Error! Invalid graph format (%s). Exiting ...\n", 
                graph_type);
        exit(-1);
    }

}
Example #2
0
int main (int argc, char** argv)
{
    graph_t g;
    init(argc, argv, &g);
    gen_RMAT_graph(&g);
    //printGraph(&g);
    gen_search(&g);
    if (writeTextFile)
        writeTextGraph(&g, outFilename);
    else writeBinaryGraph(&g, outFilename);
    return 0;
}