def METHOD_NAME(self, filename):
    with gzip.open(filename, "wb") as fout:
        pickle.dump(
            {
                "compact_adj": self.compact_adj,
                "adj": self.adj,
                "degrees": self.degrees,
                "num_nodes": self.num_nodes,
            },
            fout,
        )