Hello guys, I am migrating from a code devised in networkx to Graph-tool. Now, I need to get all ancestors in graph-tool. Could you guys help me out here. I found the func all_predecessors, but I could not figured out how to use it.. since it is mandatory to pass diet_map and prep_map. Can you please help me inhere :D Thanks -- O conteúdo deste e-mail e anexos são restritos aos seus destinatários e de responsabilidade do remetente. O uso do e-mail deve estar de acordo com os regulamentos institucionais vigentes.
Am 22.02.22 um 14:53 schrieb RAFAEL SERAPILHA DURELLI:
I found the func all_predecessors, but I could not figured out how to use it.. since it is mandatory to pass diet_map and prep_map.
Can you please help me inhere :D
We cannot help with generic questions about how to use a function. There is a documentation that explains how to use it, and I cannot read your mind to determine what you did or did not understand from it. We can only help with specific questions. -- Tiago de Paula Peixoto <tiago@skewed.de>
Ok Tiago thanks. My question is, given a source node how can I get all ancestors? I tried to use all_predecessors but I dunno what is dist_map and prep_map. Question: Is possible to get all ancestors passing a node in graph-tool? Thanks.
On 22 Feb 2022, at 11:00, Tiago de Paula Peixoto <tiago@skewed.de> wrote:
Am 22.02.22 um 14:53 schrieb RAFAEL SERAPILHA DURELLI:
I found the func all_predecessors, but I could not figured out how to use it.. since it is mandatory to pass diet_map and prep_map. Can you please help me inhere :D
We cannot help with generic questions about how to use a function.
There is a documentation that explains how to use it, and I cannot read your mind to determine what you did or did not understand from it.
We can only help with specific questions.
-- Tiago de Paula Peixoto <tiago@skewed.de> _______________________________________________ graph-tool mailing list -- graph-tool@skewed.de To unsubscribe send an email to graph-tool-leave@skewed.de
-- O conteúdo deste e-mail e anexos são restritos aos seus destinatários e de responsabilidade do remetente. O uso do e-mail deve estar de acordo com os regulamentos institucionais vigentes.
Am 22.02.22 um 15:02 schrieb RAFAEL SERAPILHA DURELLI:
Ok Tiago thanks.
My question is, given a source node how can I get all ancestors? I tried to use all_predecessors but I dunno what is dist_map and prep_map.
The documentation says: dist_map : :class:`~graph_tool.VertexPropertyMap` Vertex property map with the distances from ``source`` to all other vertices. pred_map : :class:`~graph_tool.VertexPropertyMap` Vertex property map with the predecessors in the search tree. You can determine these values using the function shortest_distance(): dist_map, pred_map = shortest_distance(g, source=u, pred_map=True) -- Tiago de Paula Peixoto <tiago@skewed.de>
participants (2)
-
RAFAEL SERAPILHA DURELLI -
Tiago de Paula Peixoto