I have tried to figure out how to use Reap and Sow from searching online, but do not understand it. Can anyone help me with my line of code? The issue is that the data set is so large that it takes a very long time to compute.
I currently have a list that has just over 623,000 elements in it. My code to then loop through the list to determine the VertexDegree and then store those elements in a new list is:
s35vertlist = {}; Do[AppendTo[s35vertlist, VertexDegree[Subgraph[s35, cyclelists35[[i]]]]], {i, Length[cyclelists35]}]
Where s35vertlist is my new empty list, and cyclelists35 is my list with the large number of elements in it. I have tried
s35vertlist = {}; s35vertlist = Reap[Do[Sow[s35vertlist, VertexDegree[Subgraph[s35, cyclelists35[[i]]]]], {i, Length[cyclelists35]}]]
But it returns Null when I know that it should have least one element. So, I am hoping that someone can quickly tell me how to get Reap/Sow to work instead of AppendTo. I am sorry if this is super simple and annoying, but I can't figure it out. Thank you so much.