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 ...
随机推荐
- centos中redis安装
一.wget http://download.redis.io/releases/redis-4.0.2.tar.gz 二.tar xzf redis-4.0.2.tar.gz cd redis-4. ...
- Python --判断路径是否为目录或文件
os.path.isdir( ), os.path.isfile(),os.listdir( ), os.walk( ) 参考网址:https://blog.csdn.net/xxn_723911/a ...
- helm一键 安装mariadb-ha(详细)
一. 二.单机安装一主一从 先创建对应pv https://github.com/helm/charts/blob/master/stable/mariadb/templates/master-sta ...
- js 获取昨天,今天,本周,上周,季度等时间范围(封装的js)
(function ($, ht) { "use strict"; $.extend(ht, { clickTimeRange:function(){ //点击重置按钮,时间文本框 ...
- java 分布式id生成算法
import java.lang.management.ManagementFactory; import java.net.InetAddress; import java.net.NetworkI ...
- list map to map
Map<String, Object> merged = lists.stream() .map(Map::entrySet) .flatMap(Set::stream) .collect ...
- bootstrap全局样式二
加form-grope是为了以后更好的管理,一组form写一个form-grope 显示如下: 并排显示的话,给用户名前面再加一个div,再加horizontal,如下,并且加上control-lab ...
- Rsync数据同步服务
Rsync数据同步服务 Rsync软件适用与unix/linux/windows等多种操作系统平台 Rsync是一款开源的,快速的,多功能的,可实现全量及增量的本地或远程数据同步备份的优秀工具,可以实 ...
- python修炼第六天
越来越难了....现在啥也不想说了,撸起袖子干. 1 面向对象 先来个例子: 比如人狗大战需要有狗,人所以创建两个类别模子def Person(name,sex,hp,dps): dic = {&qu ...
- Python爬虫入门之Urllib库的高级用法
1.设置Headers 有些网站不会同意程序直接用上面的方式进行访问,如果识别有问题,那么站点根本不会响应,所以为了完全模拟浏览器的工作,我们需要设置一些Headers 的属性. 首先,打开我们的浏览 ...