Representations of graphs
We can choose between two standard ways to represent a graph
as a collection of adjacency lists or as an adjacency matrix. Either way applies
to both directed and undirected graphs. Because the adjacency-list representation
provides a compact way to represent sparse graphs—those for which
less than V ^2—it is usually the method of choice. Most of the graph algorithms
presented in this book assume that an input graph is represented in adjacencylist
form. We may prefer an adjacency-matrix representation, however, when the
graph is dense—E is close to V^2—or when we need to be able to tell quickly
if there is an edge connecting two given vertices.

A potential disadvantage of the adjacency-list representation is that it provides
no quicker way to determine whether a given edge .u; / is present in the graph
than to search for in the adjacency list AdjOEu. An adjacency-matrix representation
of the graph remedies this disadvantage, but at the cost of using asymptotically
more memory.
the adjacency matrix A of an undirected graph is its own transpose: A = AT.
In some applications, it pays to store only the entries on and above the diagonal of
the adjacency matrix, thereby cutting the memory needed to store the graph almost
in half.
Representations of graphs的更多相关文章
- [Algorithm] 如何正确撸<算法导论>CLRS
其实算法本身不难,第一遍可以只看伪代码和算法思路.如果想进一步理解的话,第三章那些标记法是非常重要的,就算要花费大量时间才能理解,也不要马马虎虎略过.因为以后的每一章,讲完算法就是这样的分析,精通的话 ...
- 某Facebook工程师写的攻略。
Chapter 1 Interesting read, but you can skip it. Chapter 2 2.1 Insertion Sort - To be honest you sho ...
- graph generation model
Generative Graph Models 第八章传统的图生成方法> The previous parts of this book introduced a wide variety of ...
- 机器学习&恶意代码检测简介
Malware detection 目录 可执行文件简介 检测方法概述 资源及参考文献 可执行文件简介 ELF(Executable Linkable Format) linux下的可执行文件格式,按 ...
- 图机器学习(GML)&图神经网络(GNN)原理和代码实现(前置学习系列二)
项目链接:https://aistudio.baidu.com/aistudio/projectdetail/4990947?contributionType=1 欢迎fork欢迎三连!文章篇幅有限, ...
- 论文阅读 DyREP:Learning Representations Over Dynamic Graphs
5 DyREP:Learning Representations Over Dynamic Graphs link:https://scholar.google.com/scholar_url?url ...
- (转)Extracting knowledge from knowledge graphs using Facebook Pytorch BigGraph.
Extracting knowledge from knowledge graphs using Facebook Pytorch BigGraph 2019-04-27 09:33:58 This ...
- 论文阅读:Videos as Space-Time Region Graphs
Videos as Space-Time Region Graphs ECCV 2018 Xiaolong Wang 2018-08-03 11:16:01 Paper:arXiv 本文利用视频中时空 ...
- ICLR 2013 International Conference on Learning Representations深度学习论文papers
ICLR 2013 International Conference on Learning Representations May 02 - 04, 2013, Scottsdale, Arizon ...
随机推荐
- 括号配对问题-java:Stack
题目描述: 现在,有一行括号序列,请你检查这行括号是否配对. 输入描述: 第一行输入一个数N(0<N<=100),表示有N组测试数据.后面的N行输入多组输入数据,每组输入数据都是一个字符串 ...
- sqlserver 查询表锁死,解除表锁死
查询锁死的表名以及ID select request_session_id id, OBJECT_NAME(resource_associated_entity_id) tableName FROM ...
- mac 中git操作账号的保存与删除
保存: 在mac中自动保存git的用户名和密码很简单,只需要在终端命令行中输入下面的命令就是: git config --global credential.helper osxkeychain 然后 ...
- python3 LDA主题模型以及TFIDF实现
import codecs #主题模型 from gensim import corpora from gensim.models import LdaModel from gensim import ...
- 正则-关于一个结果不确定现象怪的研究(reg.test(‘-1’))
先看下边代码 var value = '-1'; var reg = /^-{0,1}\d+$/g; debugger; if (reg.test(value)||reg2.test(value)) ...
- WinForm界面设计-Button添加背景图去边框
转自:https://www.cnblogs.com/tommy-huang/p/4283538.html 1.既然是添加背景图片 所以这里应该使用 Button.BackgroudImage = & ...
- hdu多校第4场E. Matrix from Arrays HDU 二维前缀和
Problem E. Matrix from Arrays Time Limit: / MS (Java/Others) Memory Limit: / K (Java/Others) Total S ...
- 多个yml文件的读取方式
1配置pom.xml文件,以下配置将默认激活-dev.yml配置文件<profiles> <profile> <id>dev&l ...
- Daily record-October
October 11. Hope is a good thing, maybe the best of things, and no good thing ever dies. 希望是美好的,也许是人 ...
- spyder中让生成的图像单独在窗口中显示
IPython 支持两种形式的绘图 终端输出图像新窗口输出图像方式 1 能够非常方便的保存输出记录(如将`IPython 终端输出转换成 Html 文件) 方式 2 则可以交互式的放大.拖动图片,并且 ...