Message Boards Message Boards

0
|
4126 Views
|
1 Reply
|
0 Total Likes
View groups...
Share
Share this post:
GROUPS:

Show interim results after abort computation / Pause compution

Posted 10 years ago

Hi,

I want to Find all cycles in a graph. I have approx. more than 50 vertices and 3000 edges so the computation needs a lot of time. I have two questions. Since I have to travel a lot I'd like to pause the computation and start it later from the point where I left (if possible).
If that's not possible I would also be happy if I could get the results until I abort/Interrupt the computation at some point. The code line looks like this:

FindCycle[RandomGraph[{50, 1000}, DirectedEdges -> True], Infinity, All] 

best regards

POSTED BY: Peanut Butter

Hello I can't see any way to get intermediate results out of FindCycle, but you could build this up by computing cycles of given lengths and saving intermediate results. For example:

rg = RandomGraph[{10, 30}, DirectedEdges -> True]
fc[i_] := fc[i] = FindCycle[rg, {i}, All]
Save["cycles.m",{fc,rg}]

And then each time you want to compute a new set of cycles, just use:

Get["cycles.m"]
fc[6]
Save["cycles.m",{fc,rg}]
POSTED BY: W. Craig Carter
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract