Can I loop a tree diagram? - d3.js

I need to show a data structure which is a hierarchical one's, except for one value I highlight on following image:
The two nodes Pages.app should be merged. I perform this structure with d3's tree layout. Can I merge this node with same layout, or should I find a graph one?

Related

How to get all root to leaf paths in a tree or a graph from a flat structure?

I working on a simple water pipeline path modelling and listing each path.
The model is simple because the pipes do not create loops or grids. It consists of nodes which are representing the edge of each pipe segment.
Based on this we can say it is similar to a Binary Tree data model. However, as I understand, trees are hierarchical data structures. And also, I see on https://www.geeksforgeeks.org/print-root-leaf-path-without-using-recursion/?ref=lbp that, data is defined with left-right-left.left etc, by describing the exact location of each node.
In my case, the data should include only the start and end nodes for each pipe segment. Each node should also include info if it is the source (root) or leaf node. Number of leaf nodes will be equal to number of paths.
My model does not require any hierarchy and also it does not require left-right definition.
In this case we may say it is similar to a Graph, but my model also does not have loops or grids.
So please advise how to model this and create an algorithm.

d3 Tree - drag and relocate nodes in d3 graphs is possible?

Is it possible to use D3 Trees and draw graph. Then let the user to rearange the nodes without changing their relationships?
I used d3 Tree functions to have the location of nodes and used my current forced directed graph. This way I could keep my current functionalities, and also having more than one parent for nodes, and user could move the nodes around. However, once user moves the node, I do not let d3 to rearrange the node when nodes is expanded. I want the node stays in the location that user moved and wants.

Node comparison for hierarchical tree

I have an algorithm to classify some websites on a hierarchical tree. But I have trouble to test on the algorithm. Say the result suppose to be at one node, but the algorithm give me a different node, how do I measure the difference between the two node.
More specifically, I have an algorithm to categorize webpage to a hierarchical category. For example, https://stackoverflow.com/ is under computer>development>development Q&A. I am trying to test how the algorithm works. And trying to come up with a way to compare two nodes on a built tree.
I have some ideas now: 1. Calculate the distance of the two nodes. 2. Get the path of two node, as two lists and compare the lists.

Nodes on force graph links in d3.js

I am trying to create a force graph with nodes on the links between main nodes (O--o--O), similar to this visualization: http://www.nytimes.com/interactive/2013/02/20/movies/among-the-oscar-contenders-a-host-of-connections.html:
More specifically, I would like the links between nodes to start and stop at a main node (O), with a link node (o) at the midpoint. Is there a straightforward way to achieve this?
Generally: Create two classes or categories of nodes ("main", "midpoint") in your network data structure and conditionally set a node's radius and other style attributes based on class membership.

Are there any tools to find duplicate sections in a tree data structure?

I'm looking for a tool that finds duplicate nodes in a tree data structure (using Freemind to map the data structure, but I'll settle for anything I can export a generic data tree out too...)
The idea is that I can break the tree down into modules which I can repeat thus simplifying the structure of the tree.
I would just have a table of subtrees.
Walk the tree depth-first. At each node, after visiting sub-nodes, if there is an equivalent node in the table, replace the current node with the one in the table. If there is not an equivalent node in the table, then add the current node to the table.
Does that do it? I believe it's called common-subexpression-elimination.
Wouldn't it actually be better to prevent duplicate nodes in a tree? Why do you need duplicate nodes in a tree?

Resources