ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Fri, 19 Apr 2013 05:52:38 +0200Generating a unique file name for each graphhttps://ask.sagemath.org/question/10040/generating-a-unique-file-name-for-each-graph/I am writing a function whose input is a graph and some other data. I would like to store the computations that this program does each time it is run in a file with one file for each graph, so that, the next time it is run, it need not recalculate the calculations it has already done. In order to do this, I would like to assign a unique file name to each graph. I was thinking of using the hash function of the combinatorial object constructed from the graph to generate file names: `CombinatorialObject(G).__hash__()`
I have two questions:
1. Will this always work (the function taking a graph to this hash is well-defined and injective)?
2. Is there a better way to do this?
AmriFri, 19 Apr 2013 05:52:38 +0200https://ask.sagemath.org/question/10040/