I tried to translate the classes of ForceAtlas2 from Java to C# (.NET 4.5) using this page:
in order to test its performance and display some trees (hierarchy).
My work consists in translating just the part of the code that is responsible for calculation (without graphics).
So, I did some modifications:
1) I deleted "ForceAtlas2Builder" class completely.
2) I transformed "ForceAtlas2LayoutData" class to an attribute of "Node" class. This class has as attributes: double x; double y; string id; double size; int degree; boolean fixed; ForceAtlas2LayoutData layout;
Of course, I defined "ForceAtlas2LayoutData" class independantly.
3) I created "Edge" class that has as attributes (properties): Node source; Node target; double weight;
4) I created an interface "IArborescence" that has as attributes: double x; double y; string id; List<Node> childrenList;
5) I created a class called "Conversion" that contains methods tranformating an "IArborescence" to a list of Node and a list of Edge. These lists are necessary to do calculations in initAlgo(), goAlgo().. in "ForceAtlas2" class.
The class "Conversion" permits to retrieve an "IArborescence" from a list of Node and a list of Edge using the unicity of each id (an attribute of Node).
6) I didn't translate Threads in a first time, in order to test the coherence of calculations.
Then I tested what I did using this algorithm in the main class:
ForceAtlas2 forceAtlas2 = new ForceAtlas2();
for (int i = 0; i < 10000; i++) // 1000 may be replaced with another number of iterations
I tried to represent the coordinates of Nodes after calculations (using R and Excel) and unfortunately I found that results are not compatible with a "force-based algorithm".
Please, can you help me to find problem(s) in what I did? (there is no error of compilation regardless the number of iteration).
Have I missed to translate some fundamental Java packages that are necessary to run this algorithm correctly?
Thanks in advance.