某些网络的python数据结构,广度优先搜索

时间:2021-10-13 18:26:47

The title may be little unclear, but to give a brief explanation, I'm applying some biological networks like protein networks to programming. I want to use a breadth-first search to calculate some values. Here's an example of a network I'm currently working with: 某些网络的python数据结构,广度优先搜索

标题可能有点不清楚,但为了给出一个简短的解释,我正在将一些生物网络如蛋白质网络应用于编程。我想使用广度优先搜索来计算一些值。以下是我正在使用的网络示例:

On a side note, just because a node isn't named doesn't mean its not a node. Just means its name is not significant for the network.

另外,仅仅因为未命名节点并不意味着它不是节点。只是意味着它的名称对网络来说并不重要。

Simpler example: 某些网络的python数据结构,广度优先搜索

更简单的例子:

My problem here is that I need to represent this network with a data structure, which I need to use to calculate 2 values for every node:

我的问题是我需要用一个数据结构来表示这个网络,我需要用它来为每个节点计算2个值:

  • The # of signal paths for a node (how many paths there are from input to output that includes the node)

    节点的信号路径数(从输入到输出的路径数包括节点)

  • The # of feedback loops for a node (how many loop paths the node is in)

    节点的反馈循环数(节点所在的循环路径数)

I need to calculate these values for every single node in the network. Python came to mind because it's a standard for bioinformatics, but I'm open to other languages with potentially built in structures. Within Python, the only thing that comes to mind is some form of DFA/dictionary sort of deal to represent these kind of networks, but I'm posting the question here to see if anyone else has a better idea.

我需要为网络中的每个节点计算这些值。 Python浮现在脑海中,因为它是生物信息学的标准,但我对其他具有潜在内置结构的语言持开放态度。在Python中,唯一想到的是某种形式的DFA /字典类型的交易来代表这种网络,但我在这里发布问题,看看是否有其他人有更好的想法。

1 个解决方案

#1


3  

NetworkX works well. If you read section 4.39.2 of the documentation, you will see how to do BFS with NetworkX

NetworkX效果很好。如果您阅读文档的第4.39.2节,您将看到如何使用NetworkX进行BFS

#1


3  

NetworkX works well. If you read section 4.39.2 of the documentation, you will see how to do BFS with NetworkX

NetworkX效果很好。如果您阅读文档的第4.39.2节,您将看到如何使用NetworkX进行BFS