Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rsearch how to select path with minimal distance between each node #175

Open
giamas opened this issue Dec 28, 2020 · 0 comments
Open

rsearch how to select path with minimal distance between each node #175

giamas opened this issue Dec 28, 2020 · 0 comments

Comments

@giamas
Copy link

giamas commented Dec 28, 2020

I'm currently using Treelib to generate a tree with node in which, for each fo them, is stored distance from its own parent node.
How can be possible to use rsearch to find path back to root with minimal distances between every node and its paretn?

Each node has a payload data element of this class:

class Star:
def init(self, position, p, hz, adv, civ, dead, life):
self.x, self.y = position
self.size = 1
self.thickness = 1
self.n_planets = p
self.n_planets_HZ = hz
self.n_planets_adv = adv
self.n_planets_civ = civ
self.n_planets_dead = dead
self.n_planets_life = life
self.spectre = ''
self.colour = (100, 100, 100)
self.mass = 0
self.radius = 0
self.luminosity = 0
self.position = position
self.parent_distance = 0

When I generate the Tree from a random field f single point (star) I stored in each of them distance between child and parent.
Now, I want to come back to root using the path composed by step with minimal distance between node and related parents.
How can be done?

Thanks,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant