I am trying to build a tree like hierarchy from modules and their respective submodules, each module has a name, data, and a list of its submodules, With this code I’m able to detect if something is a submodule of something else but I don’t know how I am supposed to form the connections/build the data structure. My desired output
Tag: tree
Python DFS nested dictionary
I’ve written a function which should be able to search a nested dictionary, using DFS, to find a specific value. The recursive element seems to be working fine, however, when the base case should return True, it simply doesn’t. And the results. As you can see, the standard output “i==i” shows that this element was evaluated correctly but the return
How can i sum up multiple inputs in one when using a submodel?
I wrote a custom Tree-RNN-CELL that can handle several different inputs when they are provided as a tuple. This is working fine, but now I wanted to put it together in a submodel, so that i can sum the 4 lines up in 2 lines and to have a better overview ( the tree gets big so its worth it)
Finding a closed path from list of start and end nodes
I have a list of edges (E) of a graph with nodes V = [1,2,3,4,5,6]: where each tuple (a,b) refers to the start & end node of the edge respectively. If I know the edges form a closed path in graph G, can I recover the path? Note that E is not the set of all edges of the graph.
how to build a tree for ordered numbers?
I am trying build a tree (dictionary ) from input numbers. My main criteria for the tree is all the nodes in a level are in a same range. ( a series of data from parent) I think you will get idea …
Python – Tree without classes
How can I implement a tree without using classes in python? I can only use lists, dictionaries and queue. Obviously without the library bintree.