当前位置:网站首页>图的一些表示方式、邻居和度的介绍
图的一些表示方式、邻居和度的介绍
2022-06-30 04:41:00 【Icy Hunter】
前言
由于最近需要学一学图神经网络,最终目标是需要用到R-GAT,但是总是不能一蹴而就的,拷下代码能跑应该不难,但是如果能够理解代码,修改代码,可能还是需要懂对应的模型理论知识。那还是先从图的表示开始吧…
下面的图是b站视频里截的,因为确实看图一目了然了
https://www.bilibili.com/video/BV1U44y1K7yP?p=2&vd_source=f57738ab6bbbbd5fe07aae2e1fa1280f
图的表示
邻接矩阵法
邻接矩阵是一种基础的图表示方式。假设一个图的节点数量为N,则生成一个N*N的矩阵。矩阵中的值为对应位置节点与节点之间的关系一般用A表示。
若节点i与节点j右边链接,则邻接矩阵的对应位置赋值1即可
无向图(边没有方向,即不区分1->2和2->1):
有向图:
有权有向图:
矩阵中的值用权重来表示即可
邻接列表法
邻接列表对于稀疏大图十分友好
有向无权图:
有向有权图:
边集法
头尾节点的元组来表示一组边
有向图:
无向图:
有向有权图:
邻居和度
节点的邻居指的是与该节点再同一边另一端的节点。
节点的度指的是该节点邻居的数量
无向图:
有向图:
有向图的邻居分为前继邻居和后继邻居,度又可分为入度和出度。
前继邻居:目标节点作为尾节点时与它相连的头节点。
后继邻居:目标节点作为头节点时,与它相连的尾节点。
入读:前继邻居的数量
出度:后继邻居的数量
边栏推荐
- Input / output and interrupt technology -- microcomputer Chapter 6 learning notes
- Myrpc version 6
- Cheap SSL certificate abroad
- Requirements for transfer transaction cases: 1 Employee 1 transfers money to employee 2. Therefore, two update sals should be executed. Purpose: either both updates are successful or both implementati
- FortiGate creates multiple corresponding DDNS dynamic domain names for multiple ADSL interfaces
- Collective system
- Array of small C
- SSL universal domain name certificate
- Qt 6.3.1Conan软件包发布
- How to apply for SSL certificate from the manufacturer
猜你喜欢
Introduction to system programming
输入输出及中断技术——微机第六章学习笔记
基于servlet+jsp+mysql实现的工资管理系统【源码+数据库】
Redis implements SMS login function (II) redis implements login function
Myrpc version 3
Junior students summarize JS advanced interview questions
Imile uses Zadig's multi cloud environment to deploy thousands of times a week to continuously deliver global business across clouds and regions
Redis cache avalanche, breakdown and penetration
Matlab reads fig file and restores signal
iMile 利用 Zadig 多云环境周部署千次,跨云跨地域持续交付全球业务
随机推荐
File and IO
Network layer protocol hardware
Threejs realizes the simulation of river, surface flow, pipe flow and sea surface
What is SQL injection and how to avoid it?
[control] multi agent system summary. 4. control agreement.
Enlist soldiers and generals, draw small programs, multi-threaded display time
Circle center technology, very anxious?
One interview question every day to talk about the process of TCP connection and disconnection
Input / output and interrupt technology -- microcomputer Chapter 6 learning notes
My idea configuration
QT creator 8 beta2 release
IIS request SSL certificate
IO stream, byte stream read / write copy
Threadlocal
Named pipes for interprocess communication
How to apply for SSL certificate from the manufacturer
IO stream, character read / write, copy
Code cloud fatal: authentication failed for
FortiGate configures multiple server IPS as link monitor monitoring objects on the same interface
Array of small C