图的边列表、邻接表区别

[an error occurred while processing this directive] [an error occurred while processing this directive]

Graph File Formats:

The graph file formats include an adjacency graph format, an edge graph format, and a weighted edge graph format. All formats are ascii and entries are delimited by any consecutive sequence of delimiter characters: tabspaceline feed (ascii 0x0A), and carriage return (ascii 0x0D). Files can start and end with delimiters, which are ignored. Throughout the description n refers to the number of vertices and m to the number of edges in a graph.

Adjacency Graph

The adjacency graph format starts with a sequence of offsets one for each vertex, followed by a sequence of directed edges ordered by their source vertex. The offset for a vertex i refers to the location of the start of a contiguous block of out edges for vertex i in the sequence of edges. The block continues until the offset of the next vertex, or the end if i is the last vertex. All vertices and offsets are 0 based and represented in decimal. The specific format is as follows:

AdjacencyGraph
<o0>
<o1>
...
<o(n-1)>
<e0>
<e1>
...
<e(m-1)>

Edge Graph

The edge graph format consists of a sequence of edges/arcs each being a pair of integers. The format can either be interpreted as a directed graph or an undirected graphs depending on the application. Vertices are assumed to start at 0. The specific format is as follows:

EdgeArray
<s0> <t0>
<s1> <t1>
...
<s(n-1)> <t(n-1)>
where <si> and <ti> refer to the two endpoints of the undirected edge i, or the source and target of a directed edge (arc) i.

Weighted Edge Graph

The weighted edge graph format is the same as the edge graph format but includes double precision floating point weights. The specific format is as follows:

WeightedEdgeArray
<s0> <t0> <w0>
<s1> <t1> <w1>
...
<s(n-1)> <t(n-1)> <w(n-1)>
where <wi> is the weight of edge i. The weight can either be in decimal or exponential notation.

[an error occurred while processing this directive]

posted @ 2020-03-22 09:09  张杨  阅读(1097)  评论(0)    收藏  举报
编辑推荐:
· C# 代码如何影响 CPU 缓存速度?
· 智能桌面机器人:使用 .NET 为树莓派开发 Wifi 配网功能
· C# 模式匹配全解:原理、用法与易错点
· 记一次SSD性能瓶颈排查之路——寿命与性能之间的取舍
· 理解 .NET 结构体字段的内存布局
阅读排行:
· 【故障公告】6月9日 17:24~17:34 再次遭遇攻击(晚上遭遇更疯狂的攻击)
· 3 个超火的开源项目「GitHub 热点速览」
· C#-Visual Studio工具使用实践
· 时隔半年,拾笔分享:来自一个大龄程序员的迷茫自问
· [原创]《C#高级GDI+实战:从零开发一个流程图》第02章:画一个矩形,能拖动!
历史上的今天:
2019-03-22 设置SSH免密码登录
2019-03-22 【转载】failed to initialize nvml driver/library version mismatch ubuntu
点击右上角即可分享
微信分享提示