old/gen_iso_graph.py
def save_graph(nodes, num_graph, db_path = "./graph.db" ):
    """
    Looks for graph.db, creates graph.db if it doesn't exist
    Run gen_rnd_graph(nodes), creates up till the nodes in parameters. Doesn't create for 3 nodes and below.
    and store it with sqlite3


    :param: nodes := number of nodes the database will make until(int)
    :param: num_graph := number of graphs to generate (int)
    :param: db_path := path of sqlite3 db, default is same directory as gen_iso_graph.py
    """

    # in event connection to database is not possible put None
    conn = None

    # connect to db path
    # will make sql database if it doesn't exist
    conn = sqlite3.connect(db_path)

    with conn:
        # 1st loop to make various tables with various nodes x
        # 2nd loop to make insert gen_rnd_graph entries with nodes x
        for x in range(3,nodes):
            cur = conn.cursor()
            # Create Table this string formatting of a SQL command is generally
            # bad but we can make do with this for now.
            cur.execute("CREATE TABLE IF NOT EXISTS Node_{} (Id INT, Graph1 BLOB, Graph2 BLOB, is_isomorphic INT)".format(str(x)))

            for num in range(num_graph):
                g1, g2 , is_isomorphic = gen_rnd_graph(x)

                # Convert np tostring
                # To retrieve back using np.fromstring(bytearray)
                cur.execute("INSERT INTO Node_{} VALUES(?,?,?,?)".format(str(x))
                            ,(num, g1.tostring(), g2.tostring(), is_isomorphic))

        conn.commit()

    Looks for graph.db, creates graph.db if it doesn't exist
    Run gen_rnd_graph(nodes), creates up till the nodes in parameters. Doesn't create for 3 nodes and below.
    and store it with sqlite3


    :param: nodes := number of nodes the database will make until(int)
    :param: num_graph := number of graphs to generate (int)
    :param: db_path := path of sqlite3 db, default is same directory as gen_iso_graph.py
    
Looks for graph.db, creates graph.db if it doesn't exist
Run gen_rnd_graph(nodes), creates up till the nodes in parameters. Doesn't create for 3 nodes and below.
and store it with sqlite3


Looks for graph . db creates graph . db if it doesn ' t exist Run gen_rnd_graph ( nodes ) creates up till the nodes in parameters . Doesn ' t create for 3 nodes and below . and store it with sqlite3
def save_graph(nodes, num_graph, db_path = "./graph.db" ):
    conn = None
    conn = sqlite3.connect(db_path)
    with conn:
        for x in range(3,nodes):
            cur = conn.cursor()
            cur.execute("CREATE TABLE IF NOT EXISTS Node_{} (Id INT, Graph1 BLOB, Graph2 BLOB, is_isomorphic INT)".format(str(x)))
            for num in range(num_graph):
                g1, g2 , is_isomorphic = gen_rnd_graph(x)
                cur.execute("INSERT INTO Node_{} VALUES(?,?,?,?)".format(str(x))
                            ,(num, g1.tostring(), g2.tostring(), is_isomorphic))
        conn.commit()
def save_graph ( nodes , num_graph , db_path = "./graph.db" ) : conn = None conn = sqlite3 . connect ( db_path ) with conn : for x in range ( 3 , nodes ) : cur = conn . cursor ( ) cur . execute ( "CREATE TABLE IF NOT EXISTS Node_{} (Id INT, Graph1 BLOB, Graph2 BLOB, is_isomorphic INT)" . format ( str ( x ) ) ) for num in range ( num_graph ) : g1 , g2 , is_isomorphic = gen_rnd_graph ( x ) cur . execute ( "INSERT INTO Node_{} VALUES(?,?,?,?)" . format ( str ( x ) ) , ( num , g1 . tostring ( ) , g2 . tostring ( ) , is_isomorphic ) ) conn . commit ( )
Looks for graph.db, creates graph.db if it doesn't exist
Run gen_rnd_graph(nodes), creates up till the nodes in parameters.
Looks for graph . db creates graph . db if it doesn ' t exist Run gen_rnd_graph ( nodes ) creates up till the nodes in parameters .
"""
    Looks for graph.db, creates graph.db if it doesn't exist
    Run gen_rnd_graph(nodes), creates up till the nodes in parameters. Doesn't create for 3 nodes and below.
    and store it with sqlite3


    :param: nodes := number of nodes the database will make until(int)
    :param: num_graph := number of graphs to generate (int)
    :param: db_path := path of sqlite3 db, default is same directory as gen_iso_graph.py
    """ # in event connection to database is not possible put None # connect to db path # will make sql database if it doesn't exist # 1st loop to make various tables with various nodes x # 2nd loop to make insert gen_rnd_graph entries with nodes x # Create Table this string formatting of a SQL command is generally # bad but we can make do with this for now. # Convert np tostring # To retrieve back using np.fromstring(bytearray)
nodes
num_graph
db_path