[英]How to find inlet and outlet nodes in undirected networkX graph of complicated skeleton of pathes in porous structure?
Hello!你好! I have a networkX graph of skeleton of inner space in porous structure.
我有一个多孔结构内部空间骨架的networkX图。 I need to calculate lengths of paths between the inlet and outlet nodes.
我需要计算入口和出口节点之间的路径长度。 In order to do it I consider nodes with z coordinate more/less than certain number (lower and upper black lines) and if they has paths between each other I calculate them.
为了做到这一点,我考虑了 z 坐标大于/小于某个数字(下黑线和上黑线)的节点,如果它们之间有路径,我会计算它们。 But with that approach I calculate almost the same paths several times because I don't know how to define only inlet (or outlet).
但是使用这种方法,我多次计算几乎相同的路径,因为我不知道如何仅定义入口(或出口)。
Would it not be enough to这还不够吗
itertools.product
) and stash them into a dict mapping pairs to paths ( dict.fromkeys(combinations, None)
)itertools.product
)并将它们存储到一个字典映射对到路径( dict.fromkeys(combinations, None)
)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.