import sys
import os
os.chdir("..")

import pickle
import networkx as nx
import matplotlib.pyplot as plt
from classes import Problems as P

current_path = os.path.abspath(os.curdir)
graphs_path = current_path + '/data/'
problems_path = current_path + '/classes/'
figures_path = current_path + '/figures/'

for i in range(16):
    g = P.Problems(verbose=True)
    path = graphs_path + "graph_"+str(i)+".nx"
    with open(path, "wb") as fp:   
        pickle.dump(g, fp) 

# Graphs
graphs = []
for i in range(16):
    sys.path.append("classes/")
    path = "data/graph_"+str(i)+".nx"
    with open(path, 'rb') as f:
        g = pickle.load(f)
    graphs.append(g)

graphs[0].get_draw()

graphs[15].get_draw()