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】【12】精确的加减乘除运算
前言:用了BigDecimal对象 正文: 1,加法 /** * @param v1 被加数 * @param v2 加数 * @param scale 保留几位小数*/ public static ...
- ajax、axios、fetch之间的详细区别以及优缺点
1.jQuery ajax $.ajax({ type: 'POST', url: url, data: data, dataType: dataType, success: function () ...
- MySQL备份脚本-亲试ok
#!/bin/bash # 以下配置信息请自己修改mysql_user="USER" #MySQL备份用户mysql_password="123456" #My ...
- Centos7安装Nginx+PHP+MySQL
之前曾经在服务器上从头到尾搭过一次环境,但那时新手一枚,很多地方搞不定,是前辈帮忙解决的.这次独自一人在服务器上撘环境,感慨上次没有做好相关笔记,所以事后整理一下,下次再搭环境时可以轻车熟路. 一.准 ...
- springcloud-hystrix断路器对微服务的容错处理
使用Hystrix实现微服务的容错处理 1.实现容错的手段 如果服务提供者响应的速度特别慢,那么消费者对提供者的请求就会强制等待,直到提供者响应或者超时.在高负载的情况下,如果不做任何处理,此类问题可 ...
- mysql 循环、游标
mysql 循环只能在存储过程.代码记录 CREATE DEFINER=`front`@`%` PROCEDURE `a_1`() BEGIN -- 声明变量,接收游标循环变量 DECLARE _co ...
- bind与继承 待研究
class a { f() { console.log('a') } get f2() { console.log('f2') return (this['f'] = this.f.bind(this ...
- C# 多线程 类构造函数 类方法之间的关系
先定一个类,既有构造函数又有类方法: public class WriteNumber { /// <summary> /// 构造函数 /// </summary> publ ...
- Linux c codeblock的使用(四):创建自己的静态函数库
从我之前的博文当中,大家应该大概了解了linux下的函数库究竟是一个什么样的东西.linux下的函数库其实就像windows中的dll文件,里面包含了程序运行所需要的函数. 其实无论是我们使用linu ...
- UVa 11389 - The Bus Driver Problem 难度:0
题目 https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&a ...