简体   繁体   English

如何在多孔结构中复杂路径骨架的无向网络X图中找到入口和出口节点?

[英]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这还不够吗

  • grab a list of possible inlet nodes (z>450)获取可能的入口节点列表 (z>450)
  • grab a list of possible outlet nodes (z<50)获取可能的出口节点列表 (z<50)
  • compute all the combinations of input/output nodes ( itertools.product ) and stash them into a dict mapping pairs to paths ( dict.fromkeys(combinations, None) )计算输入/输出节点的所有组合( itertools.product )并将它们存储到一个字典映射对到路径( dict.fromkeys(combinations, None)
  • for each combination:对于每个组合:

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM