简体   繁体   English

表示网络流的数据结构

[英]Data structure to represent network flow

What would be the correct data structure to represent this network flow?表示此网络流的正确数据结构是什么? Can anyone also explain the chosen data structure?任何人都可以解释选择的数据结构吗?

Click here to see the network flow点击这里查看网络流量

You likely want a labeled, directed graph.您可能需要一个带标签的有向图。 It might look something like this它可能看起来像这样

object node
    neighbors : list<pair<node, int>>
    label : int

The neighbors would be represented by a node, as well as the number that is placed on the edge in between them.邻居将由一个节点表示,以及放置在它们之间的边缘上的数字。 Every node would also have a label itself.每个节点本身也会有一个 label。 The entire structure would then be the collection of all nodes.整个结构将是所有节点的集合。

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

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