@staticmethod
def gformat(nx_obj, directed=False):
    """
        Formatting NetworkX graph to a Python dictionary format

        Parameters
        ----------
        - nx_obj : networkx object
          NetworkX instance of the graph

        Returns
        -------
        - [dict] Python3 dictionary of the graph where:
          key <- tuple which describes the link (node_1, node_2)
          value <- int weight of the link
        """
    graph = {}
    print('Formatting graph..')
    if directed:
        for edge in nx_obj.edges():
            graph[edge[0], edge[1]] = 1
    else:
        for edge in nx_obj.edges():
            graph[edge[0], edge[1]] = 1
            graph[edge[1], edge[0]] = 1
    return graph
