Posted

0 replies · 0 reposts · 0 likes

How to Represent Undirected Weighted Graphs Using Edge Lists https://www.youtube.com/watch?v=p1sD8ZQxFgg In the last video we talked about representing an unweighted and undirected graph using the edge list representation inside your machine. Now let's talk about how to do that exact same thing with undirected weighted graphs. We start from the previous diagram and add weight costs on every single edge. The graph is a tuple consisting of a vertex list and an edge list. Vertices are listed from left to right. Edges are stored as triples with starting node, ending node, and weight. We build the edge list by scanning nodes left to right so each undirected edge appears only once. Then we convert the representation to use indexes instead of node values. This lets you jump to any node in constant time when using a vector or array for the vertex list. This makes operations on edges and nodes much faster than linear scans for both. Next up: directed graphs, both unweighted and weighted. 0:00 Introduction to Weighted Graphs 1:00 Adding Edge Weights 3:16 Creating the Vertex List 5:19 Building the Edge List 10:34 Completing the Value-Based List 10:44 Why Value-Based Is Slow 13:04 Converting to Index-Based 15:29 Benefits of Index Lookups 17:49 Wrap-Up and Next Videos 18:22 Thank You 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/pg1Pvv5dN4Gt - Daily Motion: https://www.dailymotion.com/neurallantern - 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 edge list, undirected weighted graph, graph representation, vertex list, weighted graphs, graph theory, data structures, edge list representation, undirected graphs, node index, constant time lookup, graph algorithms, computer science, programming graphs, big o complexity

View this post on Gab