<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>C++ graph tutorial Archives - NeuralLantern.com</title>
	<atom:link href="https://www.NeuralLantern.com/tag/c-graph-tutorial/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.NeuralLantern.com/tag/c-graph-tutorial/</link>
	<description></description>
	<lastBuildDate>Tue, 14 Jul 2026 22:43:48 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.0.1</generator>

<image>
	<url>https://www.NeuralLantern.com/wp-content/uploads/2025/04/cropped-2025-04-04-Lantern-03-32x32.png</url>
	<title>C++ graph tutorial Archives - NeuralLantern.com</title>
	<link>https://www.NeuralLantern.com/tag/c-graph-tutorial/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Graph Basics in Data Structures: Nodes, Edges, and Representations</title>
		<link>https://www.NeuralLantern.com/graph-basics-in-data-structures-nodes-edges-and-representations/</link>
					<comments>https://www.NeuralLantern.com/graph-basics-in-data-structures-nodes-edges-and-representations/#respond</comments>
		
		<dc:creator><![CDATA[mike]]></dc:creator>
		<pubDate>Tue, 14 Jul 2026 22:43:47 +0000</pubDate>
				<category><![CDATA[Computer Science]]></category>
		<category><![CDATA[Data Structures]]></category>
		<category><![CDATA[Graphs]]></category>
		<category><![CDATA[Videos]]></category>
		<category><![CDATA[adjacency list]]></category>
		<category><![CDATA[adjacency matrix]]></category>
		<category><![CDATA[C++ graph tutorial]]></category>
		<category><![CDATA[computer science basics]]></category>
		<category><![CDATA[data structures tutorial]]></category>
		<category><![CDATA[directed graph]]></category>
		<category><![CDATA[edge list]]></category>
		<category><![CDATA[graph data structure]]></category>
		<category><![CDATA[graph representations]]></category>
		<category><![CDATA[graph terminology]]></category>
		<category><![CDATA[graphs computer science]]></category>
		<category><![CDATA[nodes and edges]]></category>
		<category><![CDATA[undirected graph]]></category>
		<category><![CDATA[weighted graph]]></category>
		<guid isPermaLink="false">https://www.NeuralLantern.com/?p=412</guid>

					<description><![CDATA[<p>Graphs are collections of nodes and edges, or vertices and edges. In this tutorial we implement them as template classes in C++ so you can use custom data types for nodes and edge weights. We cover undirected unweighted graphs, then add directions and weights to show path costs between cities or network nodes.</p>
<p>The post <a href="https://www.NeuralLantern.com/graph-basics-in-data-structures-nodes-edges-and-representations/">Graph Basics in Data Structures: Nodes, Edges, and Representations</a> appeared first on <a href="https://www.NeuralLantern.com">NeuralLantern.com</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<figure class="wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio"><div class="wp-block-embed__wrapper">
<iframe title="Graph Basics in Data Structures: Nodes, Edges, and Representations" width="1380" height="776" src="https://www.youtube.com/embed/bz7VFYnTTQQ?feature=oembed" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>
</div></figure>



<p class="wp-block-paragraph">Learn graph basics: nodes, edges, neighbors, adjacency. Undirected vs directed, unweighted vs weighted. Representations including edge list, adjacency list, and matrix. Great intro for computer science students.</p>



<p class="wp-block-paragraph">00:00 Graph Basics Introduction<br>00:41 Nodes and Edges<br>01:20 Node and Edge Classes in C++<br>03:46 Simple Graph Examples<br>04:29 Adding Edges &#8211; Undirected Unweighted<br>05:26 Real World Uses of Graphs<br>07:08 Graph Terminology &#8211; Neighbors and Adjacency<br>08:32 Edges Incident on Nodes<br>09:20 Graph Representations &#8211; Edge List<br>09:59 Adjacency List<br>10:27 Adjacency Matrix<br>11:19 Directed Graphs<br>13:04 Weighted Graphs and Path Costs<br>15:24 Video Conclusion</p>



<p class="wp-block-paragraph">=-=-=-=-=-=-=-=-=</p>



<p class="wp-block-paragraph">Thanks for watching!</p>



<p class="wp-block-paragraph">Find us on other social media here:</p>



<ul class="wp-block-list">
<li>https://www.NeuralLantern.com/social</li>



<li>Twitter / X: https://x.com/NeuralLantern</li>



<li>Rumble: https://rumble.com/c/c-3696939</li>



<li>BitChute: https://www.bitchute.com/channel/pg1Pvv5dN4Gt</li>



<li>Daily Motion: https://www.dailymotion.com/neurallantern</li>



<li>Minds: https://www.minds.com/neurallantern/</li>



<li>Odysee: https://odysee.com/@NeuralLantern:5</li>
</ul>



<p class="wp-block-paragraph">Please show your support!</p>



<ul class="wp-block-list">
<li>Buy me a coffee: https://ko-fi.com/neurallantern</li>



<li>Subscribe + Sharing on Social Media</li>



<li>Leave a comment or suggestion</li>



<li>Subscribe to the Blog: https://www.NeuralLantern.com</li>



<li>Watch the main &#8220;pinned&#8221; video of this channel for offers and extras</li>
</ul>



<p class="wp-block-paragraph">Hello there. Let&#8217;s talk about graphs in the context of data structures and computer science.</p>



<p class="wp-block-paragraph">I just want to talk to you about some of the basics of graphs, some ways that we could</p>



<p class="wp-block-paragraph">implement them in the future, and some terminology. Okay, so for starters, we have a little</p>



<p class="wp-block-paragraph">For starters, we have a little blank graph sheet here.</p>



<p class="wp-block-paragraph">If you saw my previous video, you&#8217;ll know already that this is a valid graph.</p>



<p class="wp-block-paragraph">It&#8217;s just totally empty.</p>



<p class="wp-block-paragraph">There&#8217;s nothing on it.</p>



<p class="wp-block-paragraph">But let me draw some data in this graph.</p>



<p class="wp-block-paragraph">So graphs are collections of nodes and edges, or vertices and edges, or vertex and edges.</p>



<p class="wp-block-paragraph">The nodes themselves, they are custom classes sometimes, other times not.</p>



<p class="wp-block-paragraph">But you can imagine that they hold some sort of custom data.</p>



<p class="wp-block-paragraph">of custom data so i know i did this in my last video but i just want to emphasize that this graph</p>



<p class="wp-block-paragraph">class if we&#8217;re talking about c plus plus it should be a template class meaning we can specify a</p>



<p class="wp-block-paragraph">custom data type that the nodes will hold and also a custom data type that the edges will have as</p>



<p class="wp-block-paragraph">their weight you know typically when you see examples of this in the wild it&#8217;s just going to</p>



<p class="wp-block-paragraph">floats and strings exotic custom classes depending on your use case it may or may not be useful to do</p>



<p class="wp-block-paragraph">that but so we&#8217;ll have a data type for our nodes and i&#8217;ll call it like n type for like our node</p>



<p class="wp-block-paragraph">type and then we&#8217;ll do another one called e type for edge type i don&#8217;t know if that&#8217;s the best way</p>



<p class="wp-block-paragraph">to write those but i&#8217;m just going to do it anyway imagine that your glass your graph like we said</p>



<p class="wp-block-paragraph">So I&#8217;m going to put a node class here.</p>



<p class="wp-block-paragraph">You can imagine this as a vertex class.</p>



<p class="wp-block-paragraph">And I&#8217;m going to say that this node holds an n type data.</p>



<p class="wp-block-paragraph">And we&#8217;ll just call it data or node value or whatever you want.</p>



<p class="wp-block-paragraph">And then the same thing for the edges.</p>



<p class="wp-block-paragraph">We&#8217;ll say we have an edge class.</p>



<p class="wp-block-paragraph">I think in my last video, instead of doing a node class, I did a vertex class.</p>



<p class="wp-block-paragraph">It&#8217;s kind of all the same.</p>



<p class="wp-block-paragraph">We&#8217;ll say we have an e type and we&#8217;ll call it weight or value or data if you want.</p>



<p class="wp-block-paragraph">or value or data if you want but I think weight is a little bit closer to what we&#8217;re going to</p>



<p class="wp-block-paragraph">actually be doing with it and what do I mean by n type and e type like what are those data types</p>



<p class="wp-block-paragraph">there that just means these are placeholder tokens so when the user actually uses your graph by</p>



<p class="wp-block-paragraph">making an instance of your graph class like they create an actual graph off of your blueprint</p>



<p class="wp-block-paragraph">class here they might decide that they want integers inside of their nodes so that&#8217;s what</p>



<p class="wp-block-paragraph">They might decide that they want floats inside of your nodes, inside of their nodes, or some</p>



<p class="wp-block-paragraph">other data type.</p>



<p class="wp-block-paragraph">And so that means like at runtime or at, I think actually at compile time for C++, this</p>



<p class="wp-block-paragraph">end type would actually change to int if they chose to use integers on the inside.</p>



<p class="wp-block-paragraph">Same thing would happen for the edge, whatever they choose for the E-type token is just going</p>



<p class="wp-block-paragraph">to end up being used at compile time to replace that E-type.</p>



<p class="wp-block-paragraph">So I don&#8217;t know.</p>



<p class="wp-block-paragraph">Here&#8217;s an example.</p>



<p class="wp-block-paragraph">example, I got a fly in my room, it&#8217;s bothering me. Imagine the user says I want a graph.</p>



<p class="wp-block-paragraph">And I&#8217;ll call it G. And so they just have to kind of specify the two data types, maybe they want the</p>



<p class="wp-block-paragraph">graph to have integer values in the nodes. And maybe, you know, floating point double precision</p>



<p class="wp-block-paragraph">floating point values on the edges. In terms of weights, you know, you could do something like</p>



<p class="wp-block-paragraph">And we have edges and this graph right here is valid.</p>



<p class="wp-block-paragraph">It&#8217;s just one node kind of floating around by itself.</p>



<p class="wp-block-paragraph">This graph is also still valid, even though we have two nodes that are floating unconnected</p>



<p class="wp-block-paragraph">and also with the same value.</p>



<p class="wp-block-paragraph">I&#8217;m just going to change the value to be different.</p>



<p class="wp-block-paragraph">Maybe I&#8217;ll get rid of this extra thing here.</p>



<p class="wp-block-paragraph">So this is a valid graph still.</p>



<p class="wp-block-paragraph">We could have like a whole bunch of nodes all over the place and they don&#8217;t really have</p>



<p class="wp-block-paragraph">to be connected.</p>



<p class="wp-block-paragraph">This is still a valid graph.</p>



<p class="wp-block-paragraph">change this to like a three, maybe change this to like an 11, change that to a six.</p>



<p class="wp-block-paragraph">What else can I change?</p>



<p class="wp-block-paragraph">How about like a 13?</p>



<p class="wp-block-paragraph">How about like a 17?</p>



<p class="wp-block-paragraph">Are there any duplicates?</p>



<p class="wp-block-paragraph">I don&#8217;t think I see any.</p>



<p class="wp-block-paragraph">All right.</p>



<p class="wp-block-paragraph">So this is a valid graph.</p>



<p class="wp-block-paragraph">The next thing that we could add to our graph is edges.</p>



<p class="wp-block-paragraph">So edges are, you know, little mini data structures that connect nodes.</p>



<p class="wp-block-paragraph">In this particular graph, I&#8217;m choosing to not have direction on my edges, which means this is a special type of graph.</p>



<p class="wp-block-paragraph">Or four that we talked about in the previous video.</p>



<p class="wp-block-paragraph">This is unweighted and also undirected, meaning there&#8217;s no weight assigned to the edges,</p>



<p class="wp-block-paragraph">which means that template weight value or the weight data type that we just talked about before.</p>



<p class="wp-block-paragraph">It&#8217;s kind of useless for this particular graph because I&#8217;m saying it&#8217;s unweighted.</p>



<p class="wp-block-paragraph">well uh all the edges if we wanted to travel through the graph along the edges we could just</p>



<p class="wp-block-paragraph">sort of go in any direction we felt like so this is unweighted and undirected</p>



<p class="wp-block-paragraph">um let&#8217;s see what else can i show you real fast okay so let&#8217;s talk about um well really fast let&#8217;s</p>



<p class="wp-block-paragraph">talk about the uses that you can have for a graph i think i talked about this in the last video</p>



<p class="wp-block-paragraph">but um you know what can we use graphs for some people think they&#8217;re databases they&#8217;re not really</p>



<p class="wp-block-paragraph">They&#8217;re not really databases.</p>



<p class="wp-block-paragraph">You could technically do that, but it would be pretty slow.</p>



<p class="wp-block-paragraph">There are much better data structures for databases.</p>



<p class="wp-block-paragraph">Really what graphs are mostly used for is to represent relationships between different</p>



<p class="wp-block-paragraph">things.</p>



<p class="wp-block-paragraph">I think I said this in the last video.</p>



<p class="wp-block-paragraph">Imagine if every single node that you see here is a city and the edges represent flight</p>



<p class="wp-block-paragraph">paths.</p>



<p class="wp-block-paragraph">So we could fly between city seven and 11.</p>



<p class="wp-block-paragraph">Oh, that&#8217;s funny.</p>



<p class="wp-block-paragraph">I&#8217;m hungry for candy bar now.</p>



<p class="wp-block-paragraph">between city seven and 11 and back and you know back in the other direction if we want to but we</p>



<p class="wp-block-paragraph">can&#8217;t actually fly from city seven to six because there&#8217;s no edge there so we could represent</p>



<p class="wp-block-paragraph">computer networks we could represent road maps airports dependency graphs game maps you could</p>



<p class="wp-block-paragraph">say like every node is somewhere your character could stand and an edge represents where your</p>



<p class="wp-block-paragraph">or represents a connection to another node so that you know your character could move there</p>



<p class="wp-block-paragraph">there&#8217;s all sorts of different things that you could represent with the graph but</p>



<p class="wp-block-paragraph">it&#8217;s not necessarily a fast database it&#8217;s more of like a relationship</p>



<p class="wp-block-paragraph">not to be confused with relational database which is supposed to be lightning fast</p>



<p class="wp-block-paragraph">like if i wanted to search for the number 17 in this graph it&#8217;s not going to be log time like a</p>



<p class="wp-block-paragraph">proper database should be it&#8217;s not going to be constant time like a hash table based database</p>



<p class="wp-block-paragraph">or like a no sql or whatever um so we have undirected and unweighted uh we talked about</p>



<p class="wp-block-paragraph">like different uses let&#8217;s talk a little bit about terminology okay for starters notice how there&#8217;s</p>



<p class="wp-block-paragraph">no hierarchy in this graph in other videos we&#8217;re going to talk about binary search trees and we</p>



<p class="wp-block-paragraph">have to have like a hierarchy there&#8217;s no parent there&#8217;s no child in these graphs there&#8217;s no uh</p>



<p class="wp-block-paragraph">you know like grandchildren ancestors descendants because there&#8217;s not really like a hierarchy it&#8217;s</p>



<p class="wp-block-paragraph">It&#8217;s just things are connected to each other or they&#8217;re not.</p>



<p class="wp-block-paragraph">But we can have something called neighbors.</p>



<p class="wp-block-paragraph">For example, if you can reach a node in one hop, then you might be able to call that a neighbor.</p>



<p class="wp-block-paragraph">So 6 and 17, those are neighbors.</p>



<p class="wp-block-paragraph">Maybe I&#8217;ll just type neighbors right here.</p>



<p class="wp-block-paragraph">Oops, neighbors.</p>



<p class="wp-block-paragraph">Because we can reach them in one hop.</p>



<p class="wp-block-paragraph">Later on, or especially if I don&#8217;t remember to mention this,</p>



<p class="wp-block-paragraph">to our graph, then something is only considered a neighbor if you can reach it while respecting</p>



<p class="wp-block-paragraph">the direction of the graph. So we have like neighbors as 6 and 17. So that means 6 and 11</p>



<p class="wp-block-paragraph">are also neighbors. 6 and 12, not neighbors because they can&#8217;t reach each other in one hop.</p>



<p class="wp-block-paragraph">Let&#8217;s see. Adjacency is basically the same thing. I can&#8217;t remember. I think we use adjacency more</p>



<p class="wp-block-paragraph">often in directed graphs, but we could say that 6 and 17 are adjacent to each other,</p>



<p class="wp-block-paragraph">adjacent to each other, which is in this context, sort of a synonym for neighbors.</p>



<p class="wp-block-paragraph">Okay. Something else that I want to talk about in terms of edges,</p>



<p class="wp-block-paragraph">edges are considered to be incident upon nodes or vertices. So like, you know,</p>



<p class="wp-block-paragraph">if I have an arrow that just kind of points to these two things, I could say,</p>



<p class="wp-block-paragraph">you know, edge is incident upon three and 12. It&#8217;s just, it just means,</p>



<p class="wp-block-paragraph">and 12th. Okay, what else should we talk about? We should talk about connected versus, no,</p>



<p class="wp-block-paragraph">that&#8217;s another video. Okay, I&#8217;m going to do another video for connected versus not connected graphs.</p>



<p class="wp-block-paragraph">Maybe I should mention that there are three ways that we can represent a graph, and then maybe I&#8217;ll</p>



<p class="wp-block-paragraph">upgrade to a directed graph in a second. If you want to know about the four different types of</p>



<p class="wp-block-paragraph">graphs, see my previous video. But for now, I&#8217;m going to say there are three ways we could</p>



<p class="wp-block-paragraph">to represent these graphs. The first way, and I&#8217;m talking about how can you represent these</p>



<p class="wp-block-paragraph">graphs inside of the machine? Like how can your computer store and process this graph and maybe</p>



<p class="wp-block-paragraph">run algorithms on it? So the first way that we could represent, at least that I&#8217;m going to talk</p>



<p class="wp-block-paragraph">about, is an edge list. Edge lists are super simple. I&#8217;m going to do a dedicated video just</p>



<p class="wp-block-paragraph">for edge lists in the future. They&#8217;re not very fast, but they&#8217;re very easy to implement. So</p>



<p class="wp-block-paragraph">So honestly, if you&#8217;re just starting with this stuff, I would recommend just implementing an edge list first</p>



<p class="wp-block-paragraph">The next thing that you can do to represent a graph in the machine is make an adjacency list</p>



<p class="wp-block-paragraph">Adjacency lists are just a little bit more complicated</p>



<p class="wp-block-paragraph">But they&#8217;re typically faster than edge lists. Not always not in all cases and</p>



<p class="wp-block-paragraph">In terms of time complexity, you might not feel like you notice much of a difference</p>



<p class="wp-block-paragraph">but empirically</p>



<p class="wp-block-paragraph">the option of skipping a lot of examinations when you don&#8217;t need to examine something,</p>



<p class="wp-block-paragraph">you kind of skip it.</p>



<p class="wp-block-paragraph">We&#8217;ll talk more about that in the future.</p>



<p class="wp-block-paragraph">But we have an edge list and adjacency list of representation.</p>



<p class="wp-block-paragraph">And then we have an adjacency matrix.</p>



<p class="wp-block-paragraph">I wish I had spell check on this.</p>



<p class="wp-block-paragraph">Otherwise, this is going to be humiliating.</p>



<p class="wp-block-paragraph">An adjacency matrix is sometimes a lightning fast representation of a graph.</p>



<p class="wp-block-paragraph">At first, you might think, wow, that&#8217;s amazing.</p>



<p class="wp-block-paragraph">I&#8217;m always going to use that.</p>



<p class="wp-block-paragraph">always going to use that. But all of these representations have strengths and weaknesses.</p>



<p class="wp-block-paragraph">None of them are better than the others in every single circumstance. So, you know, computer science</p>



<p class="wp-block-paragraph">and data structures, it&#8217;s all about weighing the pros and cons and picking the right representation</p>



<p class="wp-block-paragraph">or algorithm or whatever that&#8217;s best for you and the code and the data that you&#8217;re actually going</p>



<p class="wp-block-paragraph">to run. So three different ways that we can represent a graph in the future. And let&#8217;s see,</p>



<p class="wp-block-paragraph">already on this. We talked about the basic ways to use them sort of. We talked about neighbors</p>



<p class="wp-block-paragraph">and adjacency. Oh, I got to upgrade to a directed graph real fast just to kind of show you the</p>



<p class="wp-block-paragraph">difference here. Okay, so I&#8217;m going to duplicate this and I&#8217;m just going to start adding direction</p>



<p class="wp-block-paragraph">to all my edges. In my previous video, we talked about this. If you add direction to even one edge,</p>



<p class="wp-block-paragraph">then you have to add direction to all the other edges. Otherwise, you will have an invalid graph.</p>



<p class="wp-block-paragraph">graph so notice how I add a direction to one edge I now have an invalid graph so</p>



<p class="wp-block-paragraph">I&#8217;m just gonna do this change every single edge so that every single edge</p>



<p class="wp-block-paragraph">has a direction you know the basic thing we kind of talked about this in my</p>



<p class="wp-block-paragraph">previous video is that when traveling through the graph you&#8217;re supposed to</p>



<p class="wp-block-paragraph">only be able to travel in the direction of an edge which means if you look at</p>



<p class="wp-block-paragraph">this thing right now you&#8217;re supposed to be able to go from 11 to 7 but you&#8217;re</p>



<p class="wp-block-paragraph">be able to go from 7 to 11 because that violates the direction of the edge. When we add direction</p>



<p class="wp-block-paragraph">we&#8217;re sort of like reducing you know the flexibility of the graph so you can imagine</p>



<p class="wp-block-paragraph">that the previous version that was undirected it was sort of like every single edge here</p>



<p class="wp-block-paragraph">was really two edges pointing in opposite directions if that makes sense. So if you</p>



<p class="wp-block-paragraph">wanted to make sure that you could go back and forth between edge sorry between node 7 and 11</p>



<p class="wp-block-paragraph">the opposite direction you can also do things called parallel edges which is just to say</p>



<p class="wp-block-paragraph">i&#8217;m going to add multiple edges that that go in the same direction from the same start node to</p>



<p class="wp-block-paragraph">the same end node but i&#8217;m not going to do that here that makes it more complicated for some</p>



<p class="wp-block-paragraph">representations but we can just sort of add a whole bunch of edges i&#8217;m just going to say one</p>



<p class="wp-block-paragraph">going back and forth there and so forth remember in my previous video we talked about weighted edges</p>



<p class="wp-block-paragraph">about weighted edges which means we could add a cost to traveling along an edge so you could say</p>



<p class="wp-block-paragraph">something like uh i don&#8217;t know going from 7 to 12 let&#8217;s add another edge here if there was a cost</p>



<p class="wp-block-paragraph">on all these weights maybe i should just add that for fun we could maybe calculate which path would</p>



<p class="wp-block-paragraph">be better so let&#8217;s say we got ones over here and we got fives over here um and maybe like a like</p>



<p class="wp-block-paragraph">and I&#8217;m going to do like an eight.</p>



<p class="wp-block-paragraph">By the way, these sixes don&#8217;t have to be the same.</p>



<p class="wp-block-paragraph">You could just be two different numbers.</p>



<p class="wp-block-paragraph">So I&#8217;m going to do like a three here.</p>



<p class="wp-block-paragraph">And let me just see, have I added a weight to every single edge?</p>



<p class="wp-block-paragraph">So I know I did this in the previous video,</p>



<p class="wp-block-paragraph">but I want to do it again real fast.</p>



<p class="wp-block-paragraph">If we chose to take a path from seven to 12,</p>



<p class="wp-block-paragraph">and we said seven to 11, and then 11 to 12,</p>



<p class="wp-block-paragraph">that&#8217;s a very specific path, which is,</p>



<p class="wp-block-paragraph">it&#8217;s going to cost us five to go along that first,</p>



<p class="wp-block-paragraph">as you have to go along that first edge and then the second edge is going to cost us six</p>



<p class="wp-block-paragraph">and we&#8217;re only traveling along two edges so the total cost of that path is 11.</p>



<p class="wp-block-paragraph">On the other hand let me actually make this look pink.</p>



<p class="wp-block-paragraph">On the other hand if we&#8217;re taking a different path we might come up with a different cost</p>



<p class="wp-block-paragraph">depending on the graph. So let&#8217;s say we start at 11 start at 7 maybe we want to go down to 3</p>



<p class="wp-block-paragraph">to three and then from three we&#8217;ll go to 12 well that might be a different cost so i&#8217;m going to say</p>



<p class="wp-block-paragraph">the cost of this particular path is traveling it&#8217;s going to cost us one to go down that first edge</p>



<p class="wp-block-paragraph">and then a two to go down that second edge which means the total cost of getting to 12 is only 3</p>



<p class="wp-block-paragraph">if we take that orange path versus 11 if we take that pink path i hope you&#8217;re starting to visualize</p>



<p class="wp-block-paragraph">how graphs might be useful to visualize costs if this is a network map we just figured out that</p>



<p class="wp-block-paragraph">network map we just figured out that one route through the network might be faster or less</p>



<p class="wp-block-paragraph">costly than the other or if this is like an airport map maybe you do want to take you know</p>



<p class="wp-block-paragraph">that layover that goes down south instead of that layover that goes east in terms of</p>



<p class="wp-block-paragraph">i don&#8217;t know frequent fire miles that it costs you or money it costs you or jet fuel that it</p>



<p class="wp-block-paragraph">That&#8217;s all I wanted to talk about in this video.</p>



<p class="wp-block-paragraph">I&#8217;m going to make one more video today.</p>



<p class="wp-block-paragraph">Well, it&#8217;ll be released.</p>



<p class="wp-block-paragraph">I don&#8217;t know when, but like in my present moment.</p>



<p class="wp-block-paragraph">I&#8217;m going to make another video right after this</p>



<p class="wp-block-paragraph">where we just talk about connected graphs versus not connected graphs.</p>



<p class="wp-block-paragraph">Thank you so much for watching this video.</p>



<p class="wp-block-paragraph">I hope you learned a little bit of stuff and had a little bit of fun.</p>



<p class="wp-block-paragraph">See you in the future.</p>



<p class="wp-block-paragraph">Okay.</p>



<p class="wp-block-paragraph">In the future.</p>



<p class="wp-block-paragraph">in the future.</p>



<p class="wp-block-paragraph">So we&#8217;ll be able to do more videos, longer videos, better videos, or just I&#8217;ll be able to keep making videos in general.</p>



<p class="wp-block-paragraph">So please do me a kindness and subscribe.</p>



<p class="wp-block-paragraph">You know, sometimes I&#8217;m sleeping in the middle of the night and I just wake up because I know somebody subscribed or followed.</p>



<p class="wp-block-paragraph">It just wakes me up and I get filled with joy.</p>



<p class="wp-block-paragraph">That&#8217;s exactly what happens every single time.</p>



<p class="wp-block-paragraph">So you could do it as a nice favor to me or you could troll me if you want to just wake me up in the middle of the night.</p>



<p class="wp-block-paragraph">Just subscribe and then I&#8217;ll just wake up.</p>



<p class="wp-block-paragraph">I promise that&#8217;s what will happen.</p>



<p class="wp-block-paragraph">happen also if you look at the middle of the screen right now you should see a QR code which</p>



<p class="wp-block-paragraph">you can scan in order to go to the website which I think is also named somewhere at the bottom of</p>



<p class="wp-block-paragraph">this video and it&#8217;ll take you to my main website where you can just kind of like see all the videos</p>



<p class="wp-block-paragraph">I published and the services and tutorials and things that I offer and all that good stuff and</p>



<p class="wp-block-paragraph">if you have a suggestion for clarifications or errata or just future videos that you want to</p>



<p class="wp-block-paragraph">videos that you want to see please leave a comment or if you just want to say hey what&#8217;s up what&#8217;s</p>



<p class="wp-block-paragraph">going on you know just send me a comment whatever i also wake up for those in the middle of the</p>



<p class="wp-block-paragraph">night i get i wake up in a cold sweat and i&#8217;m like it would really it really mean the world to me i</p>



<p class="wp-block-paragraph">would really appreciate it so again thank you so much for watching this video and um enjoy the cool</p>



<p class="wp-block-paragraph">so</p>



<p class="wp-block-paragraph">Thank you.</p>
<p>The post <a href="https://www.NeuralLantern.com/graph-basics-in-data-structures-nodes-edges-and-representations/">Graph Basics in Data Structures: Nodes, Edges, and Representations</a> appeared first on <a href="https://www.NeuralLantern.com">NeuralLantern.com</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.NeuralLantern.com/graph-basics-in-data-structures-nodes-edges-and-representations/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
