I am once again done optimization for Graph. There is a lot of changes in how NodeBase are designed. Previously it was node's task to remember it's state and do some things. Now all this logic is moved into Graph class, so now Graph is NodeBase agnostic - > it can consume any custom NodeBase class, which is cool. Also I am moved from using Dictionary to store node's state. Now it is clear that you must not mess with how you create IEnumerable<NodeBase> for Graph class. It must follow the rule that every node with index M must have Id equal to M. This add some restrictions to how you can manage nodes. In the Graph constructor every node must have it's childrens begin part of IEnumerable<NodeBase>. And because of this you cannot for example extend nodes count in Graph instance or add to some NodeBase node which Id is out of range of nodes inside of Graph. <--- This action will cause IndexOutOfRange exception thrown in parallel. ActionVesitor API changed and now it have more controll over information about node it recieve. This update doubled perfomance of whole Graph, but now it will consume more RAM. Also I added one test with hand-written data to be sure that everything works.
I am once again done optimization for
Graph
. There is a lot of changes in howNodeBase
are designed. Previously it was node's task to remember it's state and do some things. Now all this logic is moved intoGraph
class, so nowGraph
isNodeBase
agnostic - > it can consume any customNodeBase
class, which is cool. Also I am moved from usingDictionary
to store node's state. Now it is clear that you must not mess with how you createIEnumerable<NodeBase>
forGraph
class. It must follow the rule that every node with indexM
must haveId
equal toM
. This add some restrictions to how you can manage nodes. In theGraph
constructor every node must have it's childrens begin part ofIEnumerable<NodeBase>
. And because of this you cannot for example extend nodes count inGraph
instance or add to someNodeBase
node whichId
is out of range of nodes inside ofGraph
. <--- This action will causeIndexOutOfRange
exception thrown in parallel.ActionVesitor
API changed and now it have more controll over information about node it recieve. This update doubled perfomance of wholeGraph
, but now it will consume more RAM. Also I added one test with hand-written data to be sure that everything works.