u/TopDownView

Is my proof correct? -> Suppose G is a connected graph and T is a circuit-free subgraph of G. Suppose also that if any edge e of G not in T is added to T, the resulting graph contains a circuit. Prove that T is a spanning tree for G.

Suppose G is a connected graph and T is a circuit-free subgraph of G. Suppose also that if any edge e of G not in T is added to T, the resulting graph contains a circuit. Prove that T is a spanning tree for G.

Proof idea: Proof aims to show that T satisfies the definition of a spanning tree. -> 'A spanning tree for a graph G is a subgraph of G that contains every vertex of G and is a tree.'

Proof:

  1. Suppose G is a connected graph and T is a circuit-free subgraph of G
  2. Suppose that if any edge e of G not in T is added to T, the resulting graph contains a circuit
  3. Claim 1: T is connected
  4. Assume for contradiction that T is not connected
  5. Let T consist of 2 connected, circuit-free components T_1 and T_2
  6. Then we can connect T_1 and T_2 with e without producing a circuit
  7. But this contradicts 2.
  8. Thus, assumption is false, so T is connected
  9. Claim 2: T contains every vertex of G
  10. Assume for contradiction that T doesn't contain every vertex of G
  11. Let v be a vertex of G that is not in T
  12. Then we can connect v and T with e without producing a circuit
  13. But this contradicts 2.
  14. Thus, assumption is false, so T contains every vertex of G
  15. By 1. and 8., T is circuit-free and connected
  16. Thus, T is a tree
  17. By 1. and 14., T is a subgraph of G and contains every vertex of G
  18. Therefore, by 16. and 17., T is a spanning tree for G

QED

---

Is my proof correct?

reddit.com
u/TopDownView — 2 days ago

Is my proof correct? -> Prove that if G is a graph with spanning tree T and e is an edge of G that is not in T, then the graph obtained by adding e to T contains one and only one set of edges that forms a circuit.

Prove that if G is a graph with spanning tree T and e is an edge of G that is not in T, then the graph obtained by adding e to T contains one and only one set of edges that forms a circuit.

Fact from the previous exercise: Given any two distinct vertices of a tree, there exists a unique path from one to the other.

Proof:

  1. Suppose G is a graph with spanning tree T and e is and edge of G that is not in T
  2. Assume for contradiction that the graph obtained by adding e to T contains more than one set of edges that form a circuit
  3. Let A be a set of edges that form circuit C_1 when e is added to T
  4. Let B be a set of edges that form circuit C_2 when e is added to T
  5. Let u, v be endpoints of e
  6. Remove e
  7. Then, there exists a path P_1 between u and v s.t. E(P_1) = A - {e}, and also, there exists a path P_2 between u and v s.t. E(P_2) = B - {e}
  8. But this contradicts the fact from the previous exercise (there can only be one unique path)
  9. Thus, the assumption is false
  10. Therefore, the graph obtained by adding e to T contains one and only one set of edges that forms a circuit

QED

---

Is my proof correct?

This is the solution from the textbook (using direct proof method):

https://preview.redd.it/l4967yavu32h1.png?width=788&format=png&auto=webp&s=caaf3247d9f3afbce221614430cd27a109ed9793

reddit.com
u/TopDownView — 2 days ago

Is my proof correct? -> Prove: Given any two distinct vertices of a tree, there exists a unique path from one to the other

Prove: Given any two distinct vertices of a tree, there exists a unique path from one to the other.

Proof:

  1. Let u, v be two distinct vertices of a tree T
  2. By def., tree is connected, so, there is a walk P_1 between u and v
  3. By def., tree is circuit-free, so P_1 is a path (since path has no repeated edges and no repeated vertices)
  4. Claim: P_1 is unique
  5. Assume for contradiction that P_1, P_2, ..., P_k are paths between u and v s.t. P_1 /= P_2 /= ... /= P_k
  6. Let P1 consist of this sequence of vertices: u ... S_1 ... v, where S_1 is a sequence of adjacent vertices s.t. S_1: w_{1_i} ... w_{1_j}, u = w_{1_i} or u /= w_{1_i} and w_{1_j} = v or w_{1_j} /= v
  7. Similarly, P_2: u ... S_2 ... v, ..., P_k: u ... S_k ... v
  8. Take P_1 and any path from P_2, ..., P_k and let that path be P_p
  9. Let w_{p_i} and w_{p_j} be starting and ending vertices of S_p
  10. Case 1: u = w_{p_i} and v = w_{p_j}
  11. Then, there are 2 paths (P_1 and P_p) connecting u and v
  12. Thus, there is a circuit C: u(=w_{p_i}) ... v(=w_{p_j}) ... u(=w_{p_i})
  13. Case 2: u = w_{p_i} and v /= w_{p_j}
  14. Then, P_p: u(=w_{p_i}) ... w_{p_j}v
  15. So, there are 2 paths (P_1 and P_p) connecting u and v
  16. Thus, there is a circuit C: u(=w_{p_i}) ... w_{p_j}v ... u(=w_{p_i})
  17. Case 3: u /= w_{p_i} and v = w_{p_j}
  18. Then, P_p: uw_{p_i} ... v(=w_{p_j})
  19. So, there are 2 paths (P_1 and P_p) connecting u and v
  20. Thus, there is a circuit C: uw_{p_i} ... v(=w_{p_j}) ... u
  21. Case 4: u /= w_{p_i} and v /= w_{p_j}
  22. Then, P_p: u ... w_{p_i} ... w_{p_j} ... v
  23. So, there are 2 paths (P_1 and P_p) connecting u and v
  24. Thus, there is a circuit C: u ... w_{p_i} ... w_{p_j} ... v ... u
  25. In all 4 cases, a circuit C is formed in T
  26. But his contradicts our supposition that T is a tree since tree is by def. circuit-free
  27. Thus, our assumption that there are multiple paths between u and v other than P_1 is wrong
  28. Therefore, P_1 is unique

QED

Illustration of 4 cases:

https://preview.redd.it/7c13cm1hax1h1.png?width=559&format=png&auto=webp&s=10ddbd05e0c5ebeb1739a9e5254d47f46dd304fd

https://preview.redd.it/cvrfa6xhax1h1.png?width=452&format=png&auto=webp&s=64f2ecb395c72331cd1415c52d7abcf9f33cc5e6

https://preview.redd.it/vhs4efgiax1h1.png?width=537&format=png&auto=webp&s=a88240f534bddf2c6156ddd2d4bcf17bb236b7a1

https://preview.redd.it/xb6tqgziax1h1.png?width=470&format=png&auto=webp&s=d31b704f67a29ac1b48b072abd1baf8056788db4

---

Is my proof correct?

I understand the proof could be more concise. This is the solution from the textbook:

https://preview.redd.it/ngv66l9lax1h1.png?width=786&format=png&auto=webp&s=59e7e6798c18f5d63b5e545f0c9bf19b067f4d03

IMO, the main distinction between my proof and textbook solution is that my proof doesn't use constriction assume 'no parallel edges in T'. So circuits in my proof could be formed with or without parallel edges. But maybe because of this, my proof is longer?

reddit.com
u/TopDownView — 3 days ago

Incomplete solution? -> Find all minimum spanning trees for graph G that can be obtained using (a) Kruskal's algorithm and (b) Prims's algorithm starting with vertex t

To solve: Find all minimum spanning trees for graph G that can be obtained using (a) Kruskal's algorithm and (b) Prims's algorithm starting with vertex t.

Graph G:

https://preview.redd.it/zr7gj8dkjx0h1.png?width=182&format=png&auto=webp&s=eb27b72760b47fe835bccb10b87d241281dd5f87

Incomplete solution:

https://preview.redd.it/aoi0li2ljx0h1.png?width=793&format=png&auto=webp&s=5a5a53f747386f71ad46595fcfae0d8c8ceac20e

Isn't it that there are 4 orders when using Kruskal's since we have two choices of 2's and two choices of 5's (2 x 2 = 4 ways to order edges)?

Isn't it that there are 2 orders when using Prim's since we have two choices of 2's (starting from vertex t: t -> w -> x -> u -> either v or y -> z)?

reddit.com
u/TopDownView — 8 days ago

Solution is wrong? -> Find all spanning trees for the graph G

Graph G:

https://preview.redd.it/od96g0s9bq0h1.png?width=126&format=png&auto=webp&s=08e85c1940cbb6209dc53cbda59650e1752120d7

Wrong solution:

https://preview.redd.it/t8i1kylabq0h1.png?width=342&format=png&auto=webp&s=1ed522b66a9f080b0ff20cd2e5e01e2efc4243a0

Correct solution:

https://preview.redd.it/w2mityhbbq0h1.png?width=1116&format=png&auto=webp&s=5e13bfda93a57f68a7d413c72db65ddacbf162d0

The graph in the first row of the wrong solution in not a tree. Also, wrong solution misses two spanning trees: the one in the first row, second column of the correct solution, and the one in the second row, first column (of the correct solution, both are purple).

Is this observation correct?

reddit.com
u/TopDownView — 9 days ago

I don't understand the proof of correctness of Dijkstra's Algorithm

reddit.com
u/TopDownView — 10 days ago

The textbook I'm using claims:

  1. The height of a rooted tree is a maximum level of any vertex of the tree.
  2. A full binary tree is a binary tree in which each parent has exactly two children.
  3. A full binary tree of height h has 2^h leaves.

If 1., 2., and 3. are true, then this is a full binary tree of height 4 that has 2^4 = 16 leaves:

https://preview.redd.it/jgidvpvx9dzg1.png?width=1122&format=png&auto=webp&s=df70e75c4e939a77129804ff04155037ccd5bea2

Clearly, this tree hasn't got 16 leaves.

Am I missing something? Are these 3 claims true?

reddit.com
u/TopDownView — 16 days ago

Find all nonisomorphic trees with 5 vertices

Isn't the solution below wrong?

https://preview.redd.it/0tw6twweb6zg1.png?width=344&format=png&auto=webp&s=6d7daddc4c6b6b0dbd8d0945fb798782835e51ff

Top 3 trees are isomorphic.

My solution (the numbers are vertex degrees):

https://preview.redd.it/dt4x2rejb6zg1.png?width=1258&format=png&auto=webp&s=9936a6fbbcc8e63088c6347d9b6b0d967fe4c1fb

So there are 3 nonisomorphic trees with 5 vertices. My blue tree is isomorphic to top 3 trees of the wrong solution. My red tree is the same as the bottom tree in the wrong solution.

reddit.com
u/TopDownView — 17 days ago

Exercise:

Prove that every nontrivial tree has at least two vertices of degree 1 by filling in the details and completing the following argument: Let T be a nontrivial tree and let S be the set of all paths from one vertex to another in T. Among all the paths in S, choose a path P with a maximum number of edges. (Why is it possible to find such a P?) What can you say about the initial and final vertices of P? Why?

I'm only interested in the question in the parenthesis: Why is it possible to find such a P?

Is the following answer correct? If not, why?

Answer (proof):

  1. FTSOC, assume it is not possible to find such P among all paths
  2. That means there are multiple paths between two vertices that have the same number of edges
  3. That implies a tree has at least one circuit
  4. But that contradicts the definition of tree
  5. Therefore, it is possible to find a path P with maximum number of edges

QED

reddit.com
u/TopDownView — 17 days ago

Considering my previous post...

Proof:

  1. Suppose G is a circuit-free graph with n vertices and >=n-1 edges
  2. Assume for contradiction that G is not connected
  3. Then, G consists of k connected components (where k>=2)
  4. Since G is circuit-free, each of G_1,G_2,...,G_k connected components is also circuit-free
  5. So each G_1,G_2,...,G_k is circuit-free and connected
  6. Thus, each G_1,G_2,...,G_k is a tree where G_1 has n_1 vertices and n_1-1 edges, G_2 has n_2 vertices and n_2-1 edges,..., G_k has n_k vertices and n_k-1 edges
  7. So, the number of edges of G equals |E(G_1)|+|E(G_2)|+...+|E(G_k)| = (n_1-1)+(n_2-1)+...+(n_k-1)=n_1+n_2+...+n_k -1-1-...-1 = n-k (because n_1+n_2+...+n_k = n and -1-1-...-1 = (-1)*k = -k)
  8. So, G has n-k edges
  9. But this contradicts our supposition that G has >=n-1 edges since n-k<n-1 (because k>=2)
  10. Therefore, G is connected

QED

Is this proof finished as is? Or do we also have to mention (by Corollary 10.4.5*) that if G has >n-1 edges, then it must have a circuit?

The way I see it, we have proved the following statement:

If a graph G is circuit-free, has n vertices and >=n-1 edges, then G is connected.

So, it is true that G is connected given that it has n-1 or &gt;n-1 edges.**

This is what is asked of us, isn't it? Or, do we actually have to prove the following 2 statements, a) and b)?

a) If a graph G is circuit-free, has n vertices and n-1 edges, then G is connected.
b) If a graph G is circuit-free, has n vertices and >n-1 edges, then G is connected.

*Corollary 10.4.5: If G is any graph with n vertices and m edges, where m and n are positive integers and m>=n, then G has a circuit.

**Here, I'm implying truth table values for OR.

reddit.com
u/TopDownView — 17 days ago

  1. Suppose G is any circuit-free, connected graph with 10 vertices and 9 edges.
  2. By definition, for any positive integer n, if G is a connected graph with n vertices and n-1 edges, then G is a tree.
  3. By 1. and 2., G is a tree.
  4. By definition, a graph is called a tree <-> it is circuit-free and connected.
  5. By 1. and 4., G is a tree.
  6. 1., 2., and 4. confirm our supposition was true.
  7. Therefore, G is connected.

QED

Is this proof correct? I seems to me this proof is neither direct proof, nor proof by contradiction? Can we make a 'true' supposition without reaching a contradiction? And then use definitions as building blocks to reach the conclusion: 'supposition/statement is true'?

reddit.com
u/TopDownView — 18 days ago

Suppose that v is a vertex of degree 1 in a connected graph G and that e is the edge
incident on v. Let G′ be the subgraph of G obtained by removing v and e from G. Must
G′ be connected? Why?

Solution:

  1. Let the set of vertices of G be V(G) = {v, v_1,..., v_n} where v is adjacent to v_1 via the edge e
  2. Let the set of vertices of G' be V(G') = {v_1,...., v_n}
  3. By definition, subgraph G' preservers edge-endpoint connections of G
  4. So, if vertices V(G) of G are connected, then vertices V(G') of G' are connected
  5. Therefore G' is connected

QED

Is my solution correct?

reddit.com
u/TopDownView — 22 days ago

Prove: If graph G has a Hamiltonian circuit and G is isomorphic to G', then G' has a Hamiltonian circuit

*Assume this statement is true: If graph G has a simple circuit of length k and G is isomorphic to G', then G' has a simple circuit of length k

  1. Suppose G and G' are isomorphic graphs and G has a Hamiltonian circuit H
  2. By def., H is a simple circuit that includes every vertex of G
  3. Let H be of length k
  4. Then, by assumption, G' has a simple circuit H' of length k that includes every vertex of G'
  5. Therefore, G' has a Hamiltonian circuit

QED

Is my proof correct?

Edit:

*This statement is proved in one of the previous exercises.

reddit.com
u/TopDownView — 24 days ago

Prove: If G is a graph that has an Euler circuit and G and G' are isomorphic, then G' has an Euler circuit.

  1. Suppose G and G' are isomorphic graphs and G has an Euler circuit (G is connected and every vertex of G has positive even degree)
  2. Suppose w and x are any two vertices in G'
  3. Because g:V(G)->V(G') is a bijection, there exist vertices u,v in G s.t. g(u)=w and g(v)=x
  4. Since G is connected, there exists a walk from u to v
  5. Then since h:E(G)->E(G') is a bijection, and since g and h preserve edge-endpoint functions, there exist a walk from g(u)=w to g(v)=x in G'
  6. Also, because of the same characteristics of g and h, g(u)=w and g(v)=x have positive even degree
  7. Therefore G' has an Euler circuit

QED

Is my proof correct?

reddit.com
u/TopDownView — 25 days ago