MaplePrimes - Questions and Posts tagged with graphtheory
http://www.mapleprimes.com/tags/graphtheory
en-us2017 Maplesoft, A Division of Waterloo Maple Inc.Maplesoft Document SystemMon, 25 Sep 2017 02:29:06 GMTMon, 25 Sep 2017 02:29:06 GMTThe most recent questions and posts on MaplePrimes tagged with graphtheoryhttp://www.mapleprimes.com/images/mapleprimeswhite.jpgMaplePrimes - Questions and Posts tagged with graphtheory
http://www.mapleprimes.com/tags/graphtheory
GraphTheory: creating a minimum spanning tree starting in a certain point and showing sequence
https://www.mapleprimes.com/questions/222165-GraphTheory-Creating-A-Minimum-Spanning?ref=Feed:MaplePrimes:Tagged With graphtheory
<p>Suppose, there are</p>
<ul>
<li>
<p>50 vertices</p>
</li>
<li>
<p>list of coordinates of these 50 vertices</p>
</li>
</ul>
<p> </p>
<p>Now I want to create a graph with minimum distance.</p>
<p>The starting point of the graph should be vertice 1. From there, the closest point has to be added to a list X. and from this point, it should calculate again the closest point and add this value to the same list X.</p>
<p> </p>
<p>So actually I want to start in point 1 and I want to see the sequence of how the graph (I think minimum spanning tree?) is created</p>
<p> </p>
<p>How can I code this in Maple?</p>
<p> </p>
<p>Thanks in advance!</p>
<p>Adam,</p>
<p dir="ltr">Suppose, there are</p>
<ul>
<li dir="ltr">
<p dir="ltr">50 vertices</p>
</li>
<li dir="ltr">
<p dir="ltr">list of coordinates of these 50 vertices</p>
</li>
</ul>
<p dir="ltr"> </p>
<p dir="ltr">Now I want to create a graph with minimum distance.</p>
<p dir="ltr">The starting point of the graph should be vertice 1. From there, the closest point has to be added to a list X. and from this point, it should calculate again the closest point and add this value to the same list X.</p>
<p dir="ltr"> </p>
<p dir="ltr">So actually I want to start in point 1 and I want to see the sequence of how the graph (I think minimum spanning tree?) is created</p>
<p dir="ltr"> </p>
<p dir="ltr">How can I code this in Maple?</p>
<p dir="ltr"> </p>
<p dir="ltr">Thanks in advance!</p>
<p dir="ltr">Adam,</p>
222165Mon, 19 Jun 2017 20:35:08 ZascottascottHow do I generate all non-isomorphic trees of order 7 in Maple?
https://www.mapleprimes.com/questions/221720-How-Do-I-Generate-All-Nonisomorphic?ref=Feed:MaplePrimes:Tagged With graphtheory
<p>I could keep on using the commands </p>
<p><strong>with(GraphTheory):</strong></p>
<p><strong>with(RandomGraphs):</strong></p>
<p><strong>DrawGraph(RandomTree(7))</strong></p>
<p>but then this is not helpful because I do not get non-isomorphic graph each time and there are repetitions. So any other suggestions would be very helpful. </p>
<p>I could keep on using the commands </p>
<p><strong>with(GraphTheory):</strong></p>
<p><strong>with(RandomGraphs):</strong></p>
<p><strong>DrawGraph(RandomTree(7))</strong></p>
<p>but then this is not helpful because I do not get non-isomorphic graph each time and there are repetitions. So any other suggestions would be very helpful. </p>
221720Tue, 18 Apr 2017 19:52:50 Zshrey183shrey183How to color a copy of a Graph without altering the color of this Graph ?
https://www.mapleprimes.com/questions/221471-How-To-Color-A-Copy-Of-A-Graph-Without?ref=Feed:MaplePrimes:Tagged With graphtheory
<p>Hi,<br>
<br>
This question concerns the package <strong>GraphTheory</strong><br>
( Maple 2015 on a Windows 7 PC )<br>
<br>
Let G1 be some graph and V a list of vertices in G1<br>
The default colors DrawGraph uses for the vertices is yellow<br>
<br>
I define the graph G2 this way :<br>
G2 :=<strong> copy</strong>(G1):<br>
HighlightVertex(G2, V, red);<br>
DrawGraph(G2);<br>
Obviously the result is a graph where vertices in V are red while the remaining ones are still yellow<br>
<br>
<strong>Question 1</strong> : Why does the command DrawGraph(G1) returns exactly the same picture ?<br>
I have thought that defining G2 as a <strong>copy</strong> of G1 would have preserved the default colouring of the vertices.<br>
<span style="color: rgb(0, 0, 255);">Note that the same undesired (at least for me) thing occurs with the HighlightEdges command.</span><br>
<br>
<strong>Question 2</strong> : Is it possible to retrieve the original colouring of G1 without using HighlightVertex(G1, V, yellow) ?<br>
<br>
Thank you in advance</p>
<p>Hi,<br>
<br>
This question concerns the package <strong>GraphTheory</strong><br>
( Maple 2015 on a Windows 7 PC )<br>
<br>
Let G1 be some graph and V a list of vertices in G1<br>
The default colors DrawGraph uses for the vertices is yellow<br>
<br>
I define the graph G2 this way :<br>
G2 :=<strong> copy</strong>(G1):<br>
HighlightVertex(G2, V, red);<br>
DrawGraph(G2);<br>
Obviously the result is a graph where vertices in V are red while the remaining ones are still yellow<br>
<br>
<strong>Question 1</strong> : Why does the command DrawGraph(G1) returns exactly the same picture ?<br>
I have thought that defining G2 as a <strong>copy</strong> of G1 would have preserved the default colouring of the vertices.<br>
<span style="color: rgb(0, 0, 255);">Note that the same undesired (at least for me) thing occurs with the HighlightEdges command.</span><br>
<br>
<strong>Question 2</strong> : Is it possible to retrieve the original colouring of G1 without using HighlightVertex(G1, V, yellow) ?<br>
<br>
Thank you in advance</p>
221471Fri, 17 Mar 2017 10:32:41 Zsand15sand15Is it possible to give an edge of a graph an infinite weight ?
https://www.mapleprimes.com/questions/221320-Is-It-Possible-To-Give-An-Edge-Of-A?ref=Feed:MaplePrimes:Tagged With graphtheory
<p>Hi everybody, <br>
<br>
Only weights of type "numeric" can be used in a weighted graph (package GraphTheory) .<br>
Is it possible to bypass this limitation and affect an infinite weight to an edge ?<br>
If not possible, does it exist some "highest numeric value" in Maple I could use instead ?<br>
(the trick of a very high value doesn't suit me)<br>
<br>
Subsidiary question : is it possible to change the printing format for those weights ?<br>
For instance GraphTheory:-SetEdgeWeight(MyGraph, MyEdge, 123.4) plots the value 123 on edfe MyEdge<br>
<br>
Thanks in advance</p>
<p>Hi everybody, <br />
<br />
Only weights of type "numeric" can be used in a weighted graph (package GraphTheory) .<br />
Is it possible to bypass this limitation and affect an infinite weight to an edge ?<br />
If not possible, does it exist some "highest numeric value" in Maple I could use instead ?<br />
(the trick of a very high value doesn't suit me)<br />
<br />
Subsidiary question : is it possible to change the printing format for those weights ?<br />
For instance GraphTheory:-SetEdgeWeight(MyGraph, MyEdge, 123.4) plots the value 123 on edfe MyEdge<br />
<br />
Thanks in advance</p>
221320Wed, 01 Mar 2017 06:59:50 Zsand15sand15Vertex Weight graph theory
https://www.mapleprimes.com/questions/221211-Vertex-Weight-Graph-Theory?ref=Feed:MaplePrimes:Tagged With graphtheory
<p>how to define VertexWeight in Graph Theory package</p>
<p>how to define VertexWeight in Graph Theory package</p>
221211Thu, 16 Feb 2017 15:33:21 ZhakanhakanSearch for an explanation about CycleBasis
https://www.mapleprimes.com/questions/216126-Search-For-An-Explanation-About-CycleBasis?ref=Feed:MaplePrimes:Tagged With graphtheory
<p>Could someone please explain to me why the procedure GraphTheory:-CycleBasis requires that the vertices of a graph be integers for it to work correctly ?<br>(while the definition of a graph supports other types of vertex names)<br><br><br>restart:<br>with(GraphTheory):<br><br>#------------------------------------------------------- test 1<br><br>g1 := Graph({{"a", 1}, {1, 3}, {"a", 3}});<br>DrawGraph(g1);<br>CycleBasis(g1);</p>
<p>Error, (in GraphTheory:-CycleBasis) cannot determine if this expression is true or false: "a" < 1<br><br></p>
<p>#------------------------------------------------------- test 2<br><br>g2 := Graph({{a, 1}, {1, 3}, {a, 3}});<br>CycleBasis(g2);</p>
<p>Error, (in GraphTheory:-CycleBasis) cannot determine if this expression is true or false: a < 1</p>
<p> </p>
<p><strong>#------------------------------------------------------- test 3</strong><br><br><strong>g3 := Graph({{4, 1}, {1, 3}, {4, 3}});</strong><br><strong>CycleBasis(g3);</strong></p>
<p><strong>[[1, 3, 4]]</strong></p>
<p> <br><em>Knowing this limitation I usually rename to integers the vertices of the graphs, next do some operations, and next go back to the original names.</em><br><br><br>Thanks for any explanation.</p><p>Could someone please explain to me why the procedure GraphTheory:-CycleBasis requires that the vertices of a graph be integers for it to work correctly ?<br>(while the definition of a graph supports other types of vertex names)<br><br><br>restart:<br>with(GraphTheory):<br><br>#------------------------------------------------------- test 1<br><br>g1 := Graph({{"a", 1}, {1, 3}, {"a", 3}});<br>DrawGraph(g1);<br>CycleBasis(g1);</p>
<p>Error, (in GraphTheory:-CycleBasis) cannot determine if this expression is true or false: "a" < 1<br><br></p>
<p>#------------------------------------------------------- test 2<br><br>g2 := Graph({{a, 1}, {1, 3}, {a, 3}});<br>CycleBasis(g2);</p>
<p>Error, (in GraphTheory:-CycleBasis) cannot determine if this expression is true or false: a < 1</p>
<p> </p>
<p><strong>#------------------------------------------------------- test 3</strong><br><br><strong>g3 := Graph({{4, 1}, {1, 3}, {4, 3}});</strong><br><strong>CycleBasis(g3);</strong></p>
<p><strong>[[1, 3, 4]]</strong></p>
<p> <br><em>Knowing this limitation I usually rename to integers the vertices of the graphs, next do some operations, and next go back to the original names.</em><br><br><br>Thanks for any explanation.</p>216126Wed, 17 Aug 2016 08:14:47 Zmmcdarammcdara