This question already has an answer here:
I'm trying to write a function which for a list of trees checks if a given tree is isomorphic with any of the listed, and if not - adds it to the list. I tried to use both
AppendTo, but they don't work ( I checked for non-isomorphic trees, and whole loop is executed, but nothing is added to the list).
Append doesn't seem to work at all (I mean outside of the loop), and
AppendTo works outside, but doesn't work in loop.
What can be a problem here?
checkIsomorph[outList_, seedling_] := For[i = 1, i <= Length[outList], i++, If[IsomorphicGraphQ[outList[[i]], seedling], Break, If[i == Length[outList], AppendTo[outList, seedling], Continue]]]