Перейти к содержимому

Directed Weighted Graph Edge List Representation

Neural Lantern

0:00 / 0:00

Directed Weighted Graph Edge List Representation

85 просмотров · 1 мес. назад
Neural Lantern
408 подписчиков
85 просмотров · 1 мес. назад
Learn how to represent a directed and weighted graph using an edge list. We start from a directed unweighted example, add weights to every edge, then store the graph as a tuple of a vertex list and an edge list. Each edge is a tuple of start node, end node, and weight. Order matters because the graph is directed. Then we convert node values to indexes so you can jump straight to a vertex in constant time instead of scanning the vertex list. That keeps edge scans closer to O(E) instead of O(E + V). This is part of a series covering all four combinations: directed vs undirected and weighted vs unweighted. Watch the earlier videos for basic graph terms and the other representations. Leave a comment if you want a topic covered next. 00:00 Intro to directed weighted edge lists 01:05 Starting from the directed unweighted graph 01:35 Adding a weight to every edge 02:48 Graph as a vertex list plus edge list 03:35 Writing the vertex list 04:18 Node classes versus raw values 05:18 Writing directed weighted edges 05:45 Order matters on directed edges 06:38 Walking remaining outgoing edges 09:08 Why value-based edges scan slowly 10:29 Replacing node values with indexes 12:36 Constant-time jumps after an edge scan 14:13 Series wrap-up 14:45 Subscribe and outro =-=-=-=-=-=-=-=-= Thanks for watching! Find us on other social media here: https://www.NeuralLantern.com/social Twitter / X: https://x.com/NeuralLantern Rumble: https://rumble.com/c/c-3696939 BitChute: https://www.bitchute.com/channel/pg1P... Daily Motion: https://www.dailymotion.com/neurallan... Minds: https://www.minds.com/neurallantern/ Odysee: https://odysee.com/@NeuralLantern:5 Please show your support! Buy me a coffee: https://ko-fi.com/neurallantern Subscribe + Sharing on Social Media Leave a comment or suggestion Subscribe to the Blog: https://www.NeuralLantern.com Watch the main "pinned" video of this channel for offers and extras