<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[CS502 Quiz 2 Solution and Discussion]]></title><description><![CDATA[<p dir="auto">The ________ given by DFS allow us to determine whether the graph contains any cycles. CS502</p>
<ul>
<li>
<p dir="auto">Order</p>
</li>
<li>
<p dir="auto"><strong>Time stamps</strong> <a href="https://cyberian.pk/assets/uploads/files/1581697710574-fundamentals-of-algorithms-cs502-handouts.pdf#page=130" target="_blank" rel="noopener noreferrer nofollow ugc">Page 130</a></p>
</li>
<li>
<p dir="auto">BFS traversing</p>
</li>
<li>
<p dir="auto">Topological sort</p>
</li>
</ul>
<p dir="auto"><img src="https://i.imgur.com/kWtCijV.png" alt="e6ac3d19-c36b-4817-855d-57b85e421b68-image.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">8.1.5    DFS - Cycles<br />
The time stamps given by DFS allow us to determine a number of things about a graph or digraph.<br />
For example, we can determine whether the graph contains any cycles. We do this with the help of the following two lemmas.</p>
]]></description><link>https://community.secnto.com//topic/1515/cs502-quiz-2-solution-and-discussion</link><generator>RSS for Node</generator><lastBuildDate>Mon, 08 Jun 2026 19:18:37 GMT</lastBuildDate><atom:link href="https://community.secnto.com//topic/1515.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 14 Feb 2020 16:48:53 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to CS502 Quiz 2 Solution and Discussion on Sun, 18 Aug 2024 21:07:57 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/moaaz" aria-label="Profile: moaaz">@<bdi>moaaz</bdi></a> said in <a href="/post/4001">CS502 Quiz 2 Solution and Discussion</a>:</p>
<blockquote>
<p dir="auto">For traversing graphs, Breadth-first search can be visualized as a wave front propagating inwards towards root (or source) node. CS502</p>
</blockquote>
<p dir="auto">For traversing the graphs, <strong>Breadth-First Search (BFS)</strong> can be visualized as a wavefront propagating inward towards the root node.</p>
]]></description><link>https://community.secnto.com//post/7445</link><guid isPermaLink="true">https://community.secnto.com//post/7445</guid><dc:creator><![CDATA[cyberian]]></dc:creator><pubDate>Sun, 18 Aug 2024 21:07:57 GMT</pubDate></item><item><title><![CDATA[Reply to CS502 Quiz 2 Solution and Discussion on Mon, 17 Feb 2020 16:30:45 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/ainhashmi" aria-label="Profile: Ainhashmi">@<bdi>Ainhashmi</bdi></a> you can choose in categories where you expect.</p>
]]></description><link>https://community.secnto.com//post/4024</link><guid isPermaLink="true">https://community.secnto.com//post/4024</guid><dc:creator><![CDATA[cyberian]]></dc:creator><pubDate>Mon, 17 Feb 2020 16:30:45 GMT</pubDate></item><item><title><![CDATA[Reply to CS502 Quiz 2 Solution and Discussion on Sun, 16 Feb 2020 11:10:16 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/moaaz" aria-label="Profile: moaaz">@<bdi>moaaz</bdi></a> said in <a href="/post/4016">CS502 Quiz 2 Solution and Discussion</a>:</p>
<blockquote>
<p dir="auto">What general property of the list indicates that the graph has an isolated vertex?</p>
</blockquote>
<p dir="auto">The Isolated vertex is not handled in list.</p>
]]></description><link>https://community.secnto.com//post/4017</link><guid isPermaLink="true">https://community.secnto.com//post/4017</guid><dc:creator><![CDATA[moaaz]]></dc:creator><pubDate>Sun, 16 Feb 2020 11:10:16 GMT</pubDate></item><item><title><![CDATA[Reply to CS502 Quiz 2 Solution and Discussion on Sun, 16 Feb 2020 10:48:36 GMT]]></title><description><![CDATA[<p dir="auto">What general property of the list indicates that the graph has an isolated vertex?</p>
<ul>
<li>
<p dir="auto">There is Null pointer at the end of list.</p>
</li>
<li>
<p dir="auto">The Isolated vertex is not handled in list.</p>
</li>
<li>
<p dir="auto">Only one value is entered in the list.</p>
</li>
<li>
<p dir="auto">There is at least one null list.</p>
</li>
</ul>
]]></description><link>https://community.secnto.com//post/4016</link><guid isPermaLink="true">https://community.secnto.com//post/4016</guid><dc:creator><![CDATA[moaaz]]></dc:creator><pubDate>Sun, 16 Feb 2020 10:48:36 GMT</pubDate></item><item><title><![CDATA[Reply to CS502 Quiz 2 Solution and Discussion on Fri, 14 Feb 2020 20:25:34 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/moaaz" aria-label="Profile: moaaz">@<bdi>moaaz</bdi></a> okey… But it’s not understood coz It’s not my subject</p>
]]></description><link>https://community.secnto.com//post/4021</link><guid isPermaLink="true">https://community.secnto.com//post/4021</guid><dc:creator><![CDATA[Ainhashmi]]></dc:creator><pubDate>Fri, 14 Feb 2020 20:25:34 GMT</pubDate></item><item><title><![CDATA[Reply to CS502 Quiz 2 Solution and Discussion on Fri, 14 Feb 2020 20:22:51 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/moaaz" aria-label="Profile: moaaz">@<bdi>moaaz</bdi></a> ok.</p>
]]></description><link>https://community.secnto.com//post/4020</link><guid isPermaLink="true">https://community.secnto.com//post/4020</guid><dc:creator><![CDATA[Ainhashmi]]></dc:creator><pubDate>Fri, 14 Feb 2020 20:22:51 GMT</pubDate></item><item><title><![CDATA[Reply to CS502 Quiz 2 Solution and Discussion on Fri, 14 Feb 2020 18:04:58 GMT]]></title><description><![CDATA[<p dir="auto">A graph is not connected if every vertex can reach every other vertex. CS502</p>
<ul>
<li>True</li>
<li><strong>False</strong> <a href="https://cyberian.pk/assets/uploads/files/1581697710574-fundamentals-of-algorithms-cs502-handouts.pdf#page=116" target="_blank" rel="noopener noreferrer nofollow ugc">Page No. 116</a></li>
</ul>
<p dir="auto"><img src="https://i.imgur.com/xQAUMOA.png" alt="2c02c5dd-0811-49fc-9811-b18004bab115-image.png" class=" img-fluid img-markdown" /><br />
A graph is said to be acyclic if it contains no cycles. A graph is connected if every vertex can reach every other vertex. A directed graph that is acyclic is called a directed acyclic graph (DAG).</p>
]]></description><link>https://community.secnto.com//post/4004</link><guid isPermaLink="true">https://community.secnto.com//post/4004</guid><dc:creator><![CDATA[moaaz]]></dc:creator><pubDate>Fri, 14 Feb 2020 18:04:58 GMT</pubDate></item><item><title><![CDATA[Reply to CS502 Quiz 2 Solution and Discussion on Fri, 14 Feb 2020 18:00:43 GMT]]></title><description><![CDATA[<p dir="auto">In strong components algorithm, first of all DFS is run for computing finish times of vertices. CS502</p>
<ul>
<li><strong>True</strong> <a href="https://cyberian.pk/assets/uploads/files/1581697710574-fundamentals-of-algorithms-cs502-handouts.pdf#page=138" target="_blank" rel="noopener noreferrer nofollow ugc">Page No.138</a></li>
<li>False</li>
</ul>
<p dir="auto"><img src="https://i.imgur.com/li2fyQD.png" alt="8b530b5c-5a5e-4f87-8010-bccb5d28f22a-image.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">This is presented in Figure 8.37. Recall that the component DAG consists of super vertices.</p>
<p dir="auto"><img src="https://i.imgur.com/jqMtFIR.png" alt="5cf9148a-bd09-4696-87ef-b6de10a1ed71-image.png" class=" img-fluid img-markdown" /></p>
]]></description><link>https://community.secnto.com//post/4003</link><guid isPermaLink="true">https://community.secnto.com//post/4003</guid><dc:creator><![CDATA[moaaz]]></dc:creator><pubDate>Fri, 14 Feb 2020 18:00:43 GMT</pubDate></item><item><title><![CDATA[Reply to CS502 Quiz 2 Solution and Discussion on Fri, 14 Feb 2020 17:56:43 GMT]]></title><description><![CDATA[<p dir="auto">In strong components algorithm, first of all DFS is run for computing finish times of vertices. CS502</p>
<ul>
<li>[d[u], f[u&rsqb;&rsqb;⊆[d[v], f[v&rsqb;&rsqb;</li>
<li>[d[u], f[u&rsqb;&rsqb;⊇[d[v], f[v&rsqb;&rsqb;</li>
<li><strong>unrelated</strong> <a href="https://cyberian.pk/assets/uploads/files/1581697710574-fundamentals-of-algorithms-cs502-handouts.pdf#page=129" target="_blank" rel="noopener noreferrer nofollow ugc">Page No.129</a></li>
<li>Disjoint</li>
</ul>
<p dir="auto"><img src="https://i.imgur.com/vOHzZhF.png" alt="eba9d7b3-7308-4775-9b01-2a62ce935ec1-image.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">The ancestor and descendent relation can be nicely inferred by the parenthesis lemma. u is a descendent of v if and only if [d[u], f[u&rsqb;&rsqb;⊆[d[v], f[v&rsqb;&rsqb;. u is a ancestor of v if and only if[d[u], f[u&rsqb;&rsqb;⊇[d[v], f[v&rsqb;&rsqb;. u is unrelated to v if and only if[d[u], f[u&rsqb;&rsqb;and[d[v], f[v&rsqb;&rsqb;are disjoint. The is shown in Figure 8.26. The width of the rectangle associated with a vertex is equal to the time the vertex was discovered till the time the vertex was completely processed (colored black). Imagine an opening parenthesis ‘(’ at the start of the rectangle and and closing parenthesis ‘)’ at the end of the rectangle. The rectangle (parentheses) for vertex ‘b’ is completely enclosed by the rectangle for ‘a’. Rectangle for ‘c’ is completely enclosed by vertex ‘b’ rectangle.</p>
<p dir="auto"><img src="https://i.imgur.com/7paN1ei.png" alt="1ef3265c-c43b-4f86-b0e3-de47babbd3ff-image.png" class=" img-fluid img-markdown" /></p>
]]></description><link>https://community.secnto.com//post/4002</link><guid isPermaLink="true">https://community.secnto.com//post/4002</guid><dc:creator><![CDATA[moaaz]]></dc:creator><pubDate>Fri, 14 Feb 2020 17:56:43 GMT</pubDate></item><item><title><![CDATA[Reply to CS502 Quiz 2 Solution and Discussion on Fri, 14 Feb 2020 17:33:22 GMT]]></title><description><![CDATA[<p dir="auto">For traversing graphs, Breadth-first search can be visualized as a wave front propagating inwards towards root (or source) node. CS502</p>
<ul>
<li>True</li>
<li><strong>False</strong> <a href="https://cyberian.pk/assets/uploads/files/1581697710574-fundamentals-of-algorithms-cs502-handouts.pdf#page=117" target="_blank" rel="noopener noreferrer nofollow ugc">Page No.117</a></li>
</ul>
<p dir="auto"><img src="https://i.imgur.com/es2dX1k.png" alt="7bca315f-cfae-45fc-ad80-f75703426b00-image.png" class=" img-fluid img-markdown" /></p>
<p dir="auto"><strong>Breadth-first Search:</strong><br />
Here is a more efficient algorithm called the breadth-first search (BFS) Start with s and visit its adjacent nodes. Label them with distance 1. Now consider the neighbors of neighbors of s. These would be at distance 2. Now consider the neighbors of neighbors of neighbors of s. These would be at distance 3. Repeat this until no more unvisited neighbors left to visit. The algorithm can be visualized as a wave front propagating outwards from s visiting the vertices in bands at ever increasing distances from s.</p>
]]></description><link>https://community.secnto.com//post/4001</link><guid isPermaLink="true">https://community.secnto.com//post/4001</guid><dc:creator><![CDATA[moaaz]]></dc:creator><pubDate>Fri, 14 Feb 2020 17:33:22 GMT</pubDate></item><item><title><![CDATA[Reply to CS502 Quiz 2 Solution and Discussion on Fri, 14 Feb 2020 17:25:58 GMT]]></title><description><![CDATA[<p dir="auto">Digraphs are not used in communication and transportation networks. CS502</p>
<ul>
<li>True</li>
<li><strong>False</strong> <a href="https://cyberian.pk/assets/uploads/files/1581697710574-fundamentals-of-algorithms-cs502-handouts.pdf#page=135" target="_blank" rel="noopener noreferrer nofollow ugc">Page No.135</a></li>
</ul>
<p dir="auto"><img src="https://i.imgur.com/ibFlqbd.png" alt="b94832fd-0844-458d-bac8-da04d6a6e9a2-image.png" class=" img-fluid img-markdown" /></p>
<p dir="auto"><strong>Strong Components:</strong><br />
We consider an important connectivity problem with digraphs. When diagraphs are used in communication and transportation networks, people want to know that their networks are complete.</p>
]]></description><link>https://community.secnto.com//post/4000</link><guid isPermaLink="true">https://community.secnto.com//post/4000</guid><dc:creator><![CDATA[moaaz]]></dc:creator><pubDate>Fri, 14 Feb 2020 17:25:58 GMT</pubDate></item><item><title><![CDATA[Reply to CS502 Quiz 2 Solution and Discussion on Fri, 14 Feb 2020 17:17:28 GMT]]></title><description><![CDATA[<p dir="auto">You have an adjacency list for G, what is the time complexity to compute Graph transpose G^T.? CS502 ?</p>
<ul>
<li><strong>(V + E)</strong> <a href="https://cyberian.pk/assets/uploads/files/1581697710574-fundamentals-of-algorithms-cs502-handouts.pdf#page=138" target="_blank" rel="noopener noreferrer nofollow ugc">Page No.138</a></li>
<li>V E</li>
<li>V</li>
<li>E</li>
</ul>
<p dir="auto"><img src="https://i.imgur.com/snafUa7.png" alt="04ac8d73-a0fc-4599-b55f-0783827ca2e1-image.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">We will discuss the algorithm without proof. Define GT to be the digraph with the same vertex set at G but in which all edges have been reversed in direction. This is shown in Figure 8.38. Given an adjacency list for G, it is possible to compute G Tin Θ (V+E) time.</p>
]]></description><link>https://community.secnto.com//post/3999</link><guid isPermaLink="true">https://community.secnto.com//post/3999</guid><dc:creator><![CDATA[moaaz]]></dc:creator><pubDate>Fri, 14 Feb 2020 17:17:28 GMT</pubDate></item><item><title><![CDATA[Reply to CS502 Quiz 2 Solution and Discussion on Fri, 14 Feb 2020 17:18:44 GMT]]></title><description><![CDATA[<p dir="auto">In computing the strongly connected components of a digraph, vertices of the digraph are not partitioned into subsets. CS502</p>
<ul>
<li>True</li>
<li><strong>False</strong> <a href="https://cyberian.pk/assets/uploads/files/1581697710574-fundamentals-of-algorithms-cs502-handouts.pdf#page=135" target="_blank" rel="noopener noreferrer nofollow ugc">Page No.135</a></li>
</ul>
<p dir="auto"><img src="https://i.imgur.com/Nzl4fpD.png" alt="006639aa-e9db-4d84-aa28-8d45a0077238-image.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">We partition the vertices of the digraph into subsets such that the induced sub graph of each subset is strongly connected.</p>
]]></description><link>https://community.secnto.com//post/3998</link><guid isPermaLink="true">https://community.secnto.com//post/3998</guid><dc:creator><![CDATA[moaaz]]></dc:creator><pubDate>Fri, 14 Feb 2020 17:18:44 GMT</pubDate></item><item><title><![CDATA[Reply to CS502 Quiz 2 Solution and Discussion on Fri, 14 Feb 2020 17:20:34 GMT]]></title><description><![CDATA[<p dir="auto">There are no ________ edges in undirected graph. CS502</p>
<ul>
<li>Forward</li>
<li>Back</li>
<li>Cross</li>
<li><strong>Both Forward and Back</strong> <a href="https://cyberian.pk/assets/uploads/files/1581697710574-fundamentals-of-algorithms-cs502-handouts.pdf#page=130" target="_blank" rel="noopener noreferrer nofollow ugc">Page No. 130</a></li>
</ul>
<p dir="auto"><img src="https://i.imgur.com/9bOLe08.png" alt="85948814-5601-47e3-8c1b-e07a81295587-image.png" class=" img-fluid img-markdown" /><br />
For undirected graphs, there is no distinction between forward and back edges.</p>
]]></description><link>https://community.secnto.com//post/3997</link><guid isPermaLink="true">https://community.secnto.com//post/3997</guid><dc:creator><![CDATA[moaaz]]></dc:creator><pubDate>Fri, 14 Feb 2020 17:20:34 GMT</pubDate></item><item><title><![CDATA[Reply to CS502 Quiz 2 Solution and Discussion on Fri, 14 Feb 2020 17:21:50 GMT]]></title><description><![CDATA[<p dir="auto">We say that two vertices u and v are mutually not reachable if u can reach v and vice versa. CS502</p>
<ul>
<li><strong>True</strong> <a href="https://cyberian.pk/assets/uploads/files/1581697710574-fundamentals-of-algorithms-cs502-handouts.pdf#page=135" target="_blank" rel="noopener noreferrer nofollow ugc">Page No. 135</a></li>
<li>False</li>
</ul>
<p dir="auto"><img src="https://i.imgur.com/0khhzih.png" alt="8f51310c-d8e0-4973-b325-c6680ff127cb-image.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">A digraph is strongly connected if for every pair of vertices u, v∈V,u can reach v and vice versa.</p>
]]></description><link>https://community.secnto.com//post/3996</link><guid isPermaLink="true">https://community.secnto.com//post/3996</guid><dc:creator><![CDATA[moaaz]]></dc:creator><pubDate>Fri, 14 Feb 2020 17:21:50 GMT</pubDate></item></channel></rss>