开发者

graphs and their representation as edge lists

I have to represent a graph. how can this be done using edge lists? what is its format开发者_开发百科 actually?


Assuming you are talking about adjacency lists . . .

If you have a simple triangle where vertices are labeled a, b, and c, then you would use something like this:

a | b, c
b | a, c
c | a, b

Depending on the implementation language, you could use, for example, a Dictionary<string, List<string>> where the key would be the vertex label and the value would be a list of adjacent vertices.

See Wikipedia as well.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜