コード例 #1
0
ファイル: bipartite.py プロジェクト: Iykemadu/py-bipartite
def bipartite_op_mrinfo(g, params):
    filename = params[0]
    typ = params[1]
    info('  Load graph "%s"' % (filename))
    info('  as "%s"' % (typ))
    mi = MRINFO(filename)
    g = mi.to_graph(typ)
    if g == None:
        error('unknown graph type "%s"' % (typ))
    return g
コード例 #2
0
ファイル: bipartite.py プロジェクト: Iykemadu/py-bipartite
 ),
 "giant": (bipartite_op_giant, (0, 0), "", ["Extract the largest connected component of a pre-computed graph."]),
 "load": (
     bipartite_op_load,
     (2, 2),
     ":FILENAME:FORMAT",
     ["Load a graph from a file. The file FORMAT can be one of ", "gml, graphml, graphmlz, edgelist, edgelistb."],
 ),
 "mrinfo": (
     bipartite_op_mrinfo,
     (2, 2),
     ":FILENAME:TYPE",
     [
         "Load a graph in the MRINFO format. The TYPE parameter",
         "selects how the MRINFO must be loaded. The TYPE parameter can be",
         "one of %s." % (", ".join(MRINFO.get_types())),
     ],
 ),
 "orphans": (
     bipartite_op_orphans,
     (0, 0),
     "",
     ["Remove orphan vertices (O-degree vertices) from the current", "graph."],
 ),
 "plot": (
     bipartite_op_plot,
     (0, 1),
     "[:FILENAME]",
     [
         "Plot the current graph. If no FILENAME is provided, the graph",
         "is displayed on the screen. If a FILENAME is provided, the graph",