Export graph in JSON form to the given file.

def export_json(self, filename):
        """
        Export graph in JSON form to the given file.

        """
        json_graph = self.to_json()
        with open(filename, 'wb') as f:
            f.write(json_graph.encode('utf-8'))