Skip to main content

Graph Theory: Degree Sequence Algorithm ft Krita

Heyy! Welcome Back to my blog!

 Today we are doing Graph Theory. I somehow always get scared when someone mentions Graph theory. I have to overcome the fear. So here we go! I am writing some important theorems, terms, problems, etc that I learnt from the GT book. In short, Notes.

Book referred: Daniel A Marcus, Graph Theory, A Problem Oriented Approach

Chapter A:

  • Graph: A graph consists of points, which are called vertices and connections, which are called edges and which are indicated by line segments or curves joining certain pairs of vertices.
  • Degree: The degree of a vertex in a graph is the number of edges that occur at the vertex. The notation $d(a)$ represents the degree of vertex $A$.
  • Degree Theorem: In any graph $G$, the sum of all the degrees is equal to twice the number of edges.

    This is because each edge contributes $2$ to the sum of degrees i.e when an edge is removed,  $\sum_{v\in G}d(v)$ decreases by $2.$

  • Complete Graph: If all of the vertices in a graph are adjacent to each other, then the graph is called a complete graph. It is denoted as $K_n.$
  • Path in a Graph: Repetition is allowed 
  • Cycle: A cycle in a graph is a closed path in which the only repetation is the first and last vertex.
  • Cycle Graph: A cycle graph containing $n$ vertices is denoted by $C_n.$



  • Complement of a Graph: The complement of a graph $G_1$ is another graph $G_2$ having the same set of vertices but including only those edges that are not in $G_1.$


  • Connected Graph: A graph is connected if every vertex is joined to every other vertex by a path. 
  • Disconnected Graph: Not connected.
  • Component: If a graph is disconnected, then it consists of two or more components. Each component is a connected subgraph $H$ whose vertices are not adjacent to any vertices not in $H.$
  • Degree Sequence: The degree sequence of a graph is a list, or a sequence, of all the degrees of the vertices in the graph, including repetitions, usually in decreasing order.
     

    The above graph has degree sequence $(5,4,3,2,2,1).$
  • Distance: The distance between two vertices in the same component of a graph is the length of the shortest path joining these vertices. 
  • Diameter: If $G$ is a connected graph, then the diameter of $G$ is the maximum of all of the distances between vertices of $G.$
  • Max and Min degree: The maximum degree in a graph is denoted by $\Delta$ and the minimum degree $\delta$.
The Degree Sequence Algorithm:
  • Start with the terms of the sequences in decreasing order.
  • Remove the largest term $m $ and reduce the next $m$ terms each by $1.$
  • Rearrange the new sequence in decreasing order ( If needed)
The original sequence is the degree sequence of some graph iff the new sequence is.

Proof: Note that if the new sequence is graphic then clearly the old sequence is graphic too ( just add a new vertex.

Other direction. Let the degree sequence be $(s,d_1,d_2,\dots,d_s,t_1,\dots,t_n).$ And let $G$ be the graph for the degree sequence. Also, denote $v(i)$ as the vertex with with degree $i$. 
Now, we delete $v(s)$ from $G.$ 
If $v(s)$ is adjacent to $d_1,d_2,\dots,d_s$ then we are done.
So say, $v(s)$ is not adjacent to $d_j.$ Hence, it must be adjacent to some other vertex say $t_l.$ 
If $t_l=d_j$ then we can just swap them.
If $d_j>t_l$ then $v(d_j)$ is adjacent to some vertex $w$ that $v(t_l)$ isn't. 

Hence we can join $v(d_j),v(s)$ and $v(w),v(t_l)$ and remove the edge $v(d_j),v(w)$ and $v(s),v(t_l).$

And we can continue this process and make every $v(d_i)$ adjacent to $v(s).$

Problem 1: Prove that if $G_1$ and $G_2$ are complementary graphs, then at least one of them must be connected. 

Proof: Let's say $G_1$ is disconnected then let vertex $u,v$ be two vertices in same component and $w$ be in the other component. Clearly $uw,vw\not \in G_1\implies uw,vw\in G_2\implies $ there is a path between $u,v$ in $G_2.$ 

Hence in $G_2,$ the diameter is $2.$ 

Problem 2: Suppose that a graph contains $11$ vertices and that each vertex has a degree $5$ or greater. Prove that the graph must be connected.

Proof: Let's say for the sake of contradiction, the graph is disconnected. Then we consider the components. Note that there must be at least $2$ components and each component must have at least $6$ vertices since each vertex has a degree $5$ or greater. But this is not possible.

Problem 3: Show that in a graph with $n$ vertices, if $\delta +\Delta$ is greater than or equal to $n-1$ then the graph is connected.

Proof: If not, then consider the components. Clearly, there will be at least two components. So at least one component has $\Delta +1$ vertices and the other will have at least $\delta +1$ vertices. So the number of vertices would be at least $\Delta+\delta +2> n.$ Not possible.

Problem 4: Prove that in any graph with minimum degree $\delta ,$ there exists a simple path of length greater than or equal to $\delta .$

Proof: Let $\lambda$ be the length of the longest simple path. Then the endpoints of the longest path will have degree $\le \lambda.$ But the endpoint will have at least $\delta.$ So $\delta\le \lambda.$

Chapter B:
  • Isomorphism is graphs: If two graphs are isomorphic then they have the same number of vertices, the same number of edges, the same maximum and minimum degrees, same degree sequence, same length of the longest simple path, same cycle lenghts.
    However, satisfying this doesn't imply two graphs are isomorphic.
Chapter C:
  • Bipartite Graphs: It is a graph whose vertices can be separated into two sets $X$ and $Y$ in such a way that every edge in the graph has one endpoint in each set.

    Here we have $X=\{A,C,F\},Y=\{B,D,E\}$



  • Complete Bipartite Graphs: Every vertex in $X$ is adjacent to every vertex in $Y.$ They are denoted by symbol $K_{m,n},$ where $m$ and $n$ are vertices in $X$ and $Y.$

    Note that $K_{m,n}$ will have $mn$ edges and vertices in $X$ set will have degree $n$ and vertices in $Y$ set will have degree $m.$

    Here is $K_{2,5}.$


    Cycle Theorem for Bipartite Graphs: A graph is bipartite iff it contains no odd cycle.

    Proof: If the graph contains an odd cycle then it's not bipartite (colour the vertices, we won't be able to divide into two sets cause it's odd). 
    If the graph contains no odd cycle, then choose any vertex $A$ from any component of Graph $G.$ Assign it colour red and then colour the vertices adjacent to it Blue and then vertices adjacent to Blue vertices as Red and so on along simple paths from $A.$

    Note that no vertex will have two distinct colours. 
    Proof: Suppose not. Let the vertex be $W.$ Then we get $A\rightarrow W\rightarrow A$ an odd cycle.

Chapter D:
  • Tree: It is a graph that is connected and contains no cycles.
  • Forest: It is a graph in which each component is a tree.
  • Spanning Tree: A tree which is a subgraph of graph $G$ and contains every vertex of $G.$ Any connected graph would have a spanning tree.


Pruning a Tree: Removing a vertex of degree $1$ from the tree along with the edge that occurs at that vertex. 

Here is the example,

Note that after pruning, we still get a tree.

Lemma: Prove that every tree with two or more vertex has at least two leaf vertices.
Proof: Consider the longest simple path in the tree. Let the end points be $A,B.$ Let the other vertices of the graph not in the path be $d_1,d_2,\dots,d_n$ and vertices in the path be $v_1,\dots,v_k.$ Let $v_i,v_j$ be adjacent to $A,B$ respectively.
Note that $d_1,d_2,\dots,d_n$  are not adjacent to $A,B$ since we considered the longest path and $A$ is not adjacent to $v_1,\dots ,v_{i-1}v_{i+1},\dots,v_k$ else it would form a cycle. Similar to $B.$ Hence $A,B$ have degree $1.$

Tree Theorem 1:
Every tree with $v$ vertices has exactly $v-1$ edges.
Proof: Just prune it. $v-e$ is always $1.$

Forest Corollary: In a forest with $v$ vertices and $k$ components, the number of edges is $v-k.$
Proof: Each component has $v-e=1.$ 

Tree Theorem 2: In any Tree, there is exactly one simple path from any vertex to any other vertex.
Proof: Since $T$ is connected, there is a simple path. If there are two different paths then we will get a cycle.


Cayley's Formula: In a labelled complete graph with $n$ vertices, the number of spanning trees is $n^{n-2}.$

We prove it using Prufer's method which establishes a bijection between spanning trees and sequence of $n-2$ length which can be filled up in $n^{n-2}$ ways since we have $n$ numbers.

Converting the spanning-tree into Prufer's sequence: 
First label the graph with numbers. Now we construct the sequence $S.$

  • Find a leaf with the smallest label
  • Include the neighbour of the leaf and then delete the leaf 



Problem 1: Show that the average degree a tree in a tree is always less than 2. 
Proof: The number of edges is $n-1$ and the number of vertices is $n.$ So the sum of degrees is $2n-2<2n.$

Problem 2:
Show that the number of vertices of degree $1$ in any tree must be greater than or equal to the maximum degree $(\Delta)$ in the tree.
Proof: Let $A$ have degree $\Delta .$ Consider the $\Delta $ subgraphs formed by $A.$ Each will be a tree and will be disconnected ( or else we get cycle). Each tree will have one leaf. So we get $\Delta $ leaves.


Problem 3: Show that if a graph has $v$ vertices and $v-1$ edges and contains no cycle. It's connected.
Proof: If not, let there be $k$ components. These components are connected and have no cycles, hence a tree. Then we will have $v-k$ edges.


Problem 4: Show that if a graph has $v$ vertices and $v-1$ edges and is connected, then the graph has no cycles.
Proof: Since it is connected, the graph contains a spanning tree. The spanning-tree contains $v-1$ edges. Hence the graph is a tree.


Three conditions:
If graph $G$ satisfies any two of three conditions;
1. $G$ has $v$ and $v-1$ edges
2. $G$ is connected
3. $G$ contains no cycles,
then $G$ satisfies all three conditions.

Yep, this was it for the Part A of the book! I also made my first Digital Art on Krita! It did take me a lot of time. How is it?

Yee, that's it for today's blog. I will post the sequel tomorrow.

Sunaina 💜

Comments

  1. Nice content, thank you for writing this :))

    ReplyDelete
  2. Replies
    1. Thankyou :).. The book is very nice, thanks for asking me to refer :)

      Delete
  3. ooo This might be useful for me someday when I stop doing geo and start gt :| (Not anytime soon though)
    Also the flower is very nice!

    ReplyDelete
    Replies
    1. Thankyou so much for commenting! Hehe, sure Geo for life!!!! I do have another GT post, whenever you want to refer just go to the notes page! Also pro people commenting
      :ORZ:

      Delete

Post a Comment

Popular posts from this blog

My experiences at EGMO, IMOTC and PROMYS experience

Yes, I know. This post should have been posted like 2 months ago. Okay okay, sorry. But yeah, I was just waiting for everything to be over and I was lazy. ( sorry ) You know, the transitioning period from high school to college is very weird. I will join CMI( Chennai Mathematical  Institue) for bsc maths and cs degree. And I am very scared. Like very very scared. No, not about making new friends and all. I don't care about that part because I know a decent amount of CMI people already.  What I am scared of is whether I will be able to handle the coursework and get good grades T_T Anyways, here's my EGMO PDC, EGMO, IMOTC and PROMYS experience. Yes, a lot of stuff. My EGMO experience is a lot and I wrote a lot of details, IMOTC and PROMYS is just a few paras. Oh to those, who don't know me or are reading for the first time. I am Sunaina Pati. I was IND2 at EGMO 2023 which was held in Slovenia. I was also invited to the IMOTC or International Mathematical Olympiad Training Cam...

Introduction

  Hey Everyone!! This is my first Blog post. So let me give a brief introduction about myself. I am Sunaina Pati. I love solving Olympiad math problems,  learning crazy astronomical facts , playing hanabi and anti-chess, listening to Kpop , love making diagrams in Geogebra and  teaching other people maths 😊 . I love geometry , number theory and Combinatorics . I am starting this blog to keep myself a bit motivated in doing studies 😎 . Right now, I am planning to write walkthroughs on some of the best problems I tried over the week which can refer for hints 'cause solutions contain some major spoilers and one learns a lot while solving the problem on his own rather than seeing solutions . Also, there will be some reviews about Kpop songs, study techniques, my day to day lifestyles,exam reviews and ofc some non-sense surprises 😂.  I am planning to  try  posting every week on Sundays or Saturdays ( most probably) ! Though there is no guarantee about when I ...

How to prepare for RMO?

"Let's wait for this exam to get over".. *Proceeds to wait for 2 whole fricking years!  I always wanted to write a book recommendation list, because I have been asked so many times! But then I was always like "Let's wait for this exam to get over" and so on. Why? You see it's pretty embarrassing to write a "How to prepare for RMO/INMO" post and then proceed to "fail" i.e not qualifying.  Okay okay, you might be thinking, "Sunaina you qualified like in 10th grade itself, you will obviously qualify in 11th and 12th grade." No. It's not that easy. Plus you are talking to a very underconfident girl. I have always underestimated myself. And I think that's the worst thing one can do itself. Am I confident about myself now? Definitely not but I am learning not to self-depreciate myself little by little. Okay, I shall write more about it in the next post describing my experience in 3 different camps and 1 program.  So, I got...

INMO Scores and Results

Heya! INMO Results are out! Well, I am now a 3 times IMOTCer :D. Very excited to meet every one of you! My INMO score was exactly 26 with a distribution of 17|0|0|0|0|9, which was a fair grading cause after problem 1, I tried problem 6 next. I was hoping for some partials in problem 4 but didn't get any.  I am so so so excited to meet everyone! Can't believe my olympiad journey is going to end soon..  I thought to continue the improvement table I made last year! ( I would still have to add my EGMO performance and also IMO TST performance too) 2018-2019[ grade 8]:  Cleared PRMO, Cleared RMO[ State rank 4], Wrote INMO 2019-2020[ grade 9]:  Cleared PRMO, Cleared RMO[ State topper], Wrote INMO ( but flopped it) 2020-2021[grade 10]:  Cleared IOQM, Cleared INMO [ Through Girl's Quota] 2021-2022[grade 11]:  Wrote EGMO 2022 TST[ Rank 8], Qualified for IOQM part B directly, Cleared IOQM-B ( i.e INMO) [Through general quota],  2022-2023 [grade 12]:  Wrote E...

Geometry ( Finally!!!)

 This is just such an unfair blog.  Like if one goes through this blog, one can notice how dominated  Algebra is!! Like 6 out of 9 blog post is Algebra dominated -_- Where as I am not a fan of Algebra, compared to other genres of Olympiad Math(as of now). And this was just injustice for Synthetic Geo. So this time , go geo!!!!!!!!!!!  These problems are randomly from A Beautiful Journey through Olympiad Geometry.  Also perhaps I will post geo after March, because I am studying combi.  Problem:  Let $ABC$ be an acute triangle where $\angle BAC = 60^{\circ}$. Prove that if the Euler’s line of $\triangle ABC$ intersects $AB$ and $AC$ at $D$ and $E$, respectively, then $\triangle ADE$ is equilateral. Solution:  Since $\angle A=60^{\circ}$ , we get $AH=2R\cos A=R=AO$. So $\angle EHA=\angle DOA.$ Also it's well known that $H$ and $O $ isogonal conjugates.$\angle OAD =\angle EAH.$ By $ASA$ congruence, we get $AE=AD.$ Hence $\triangle ADE$ is equilateral....

Reflecting on past

INMO Scores are out!! I am now a two times INMO awardee :) I got 16|0|1, so 17 in total! Yes, 16 in P1 T_T. I was thinking I would lose marks because of the way I wrote.  Lemme tell ya'll what happened that day but first I should share a few thoughts I had before the exam. My thoughts Honestly, my preparation for INMO was bad. In fact, I should say I didn't work hard at all. As I have said earlier, I had lost all my hopes for INMO and Olympiads as a whole after EGMO TSTs happened.  Art by Jelena Janic EGMO TSTs i.e European Girl's Mathematical Olympiad Team selection Tests 2022.  Literally my thoughts after EGMO TSTs I feel very ashamed to share but I got 1 mark in my EGMO TSTs. Tests in which I literally gave my whole life. I did so many ISLs ( like SO MANY), I mocked EGMO 2021 TST where my score was 28/42 and I perfected Day 2. 1 mark in the TST just showed my true potential. There are way better people than me in olys. A friend even said to me, "If I wouldn't...

Bio is Love..

Adios, everyone! Boards preparation at its peak :(  However, I am not able to study how I used to. Every time I try to study for boards, I just keep thinking much about a topic, stare at the book, jam a song or just start doing procrastination by bookmarking random cute problems in HSO. It's been more than a year I have studied like with a focus on a book. My lappy is being a big distraction tbh. So after INMO score come out, I will just give my lappy for repair and say papa to bring it back home after June 2.  Milk and Mocha I literally am taking 2 days to complete 1 bio chapter, some times even 3. The rate of my "slowness" is probably because I am like every 15 minutes checking discord to see if the INMO scores are out or not. So HBCSE, thank you for keeping me anxious.  Funfact:- we must be grateful that there is an organisation that is conducting these national Olys. There are some countries where no Olys are being conducted. ( Same dialogue which mumma uses, but in p...

Solving Random ISLs And Sharygin Solutions! And INMO happened!!

Some of the ISLs I did before INMO :P  [2005 G3]:  Let $ABCD$ be a parallelogram. A variable line $g$ through the vertex $A$ intersects the rays $BC$ and $DC$ at the points $X$ and $Y$, respectively. Let $K$ and $L$ be the $A$-excenters of the triangles $ABX$ and $ADY$. Show that the angle $\measuredangle KCL$ is independent of the line $g$ Solution: Note that $$\Delta LDK \sim \Delta XBK$$ and $$\Delta ADY\sim \Delta XCY.$$ So we have $$\frac{BK}{DY}=\frac{XK}{LY}$$ and $$\frac{DY}{CY}=\frac{AD}{XC}=\frac{AY}{XY}.$$ Hence $$\frac{BK}{CY}=\frac{AD}{XC}\times \frac{XK}{LY}\implies \frac{BK}{BC}=\frac{CY}{XC}\times \frac{XK}{LY}=\frac{AB}{BC}\times \frac{XK}{LY} $$ $$\frac{AB}{LY}\times \frac{XK}{BK}=\frac{AB}{LY}\times \frac{LY}{DY}=\frac{AB}{DL}$$ $$\implies \Delta CBK\sim \Delta LDK$$ And we are done. We get that $$\angle KCL=360-(\angle ACB+\angle DKC+\angle BCK)=\angle DAB/2 +180-\angle DAB=180-\angle DAB/2$$ Motivation: I took a hint on this. I had other angles but I did...

IMO 2023 P2

IMO 2023 P2 Well, IMO 2023 Day 1 problems are out and I thought of trying the geometry problem which was P2.  Problem: Let $ABC$ be an acute-angled triangle with $AB < AC$. Let $\Omega$ be the circumcircle of $ABC$. Let $S$ be the midpoint of the arc $CB$ of $\Omega$ containing $A$. The perpendicular from $A$ to $BC$ meets $BS$ at $D$ and meets $\Omega$ again at $E \neq A$. The line through $D$ parallel to $BC$ meets line $BE$ at $L$. Denote the circumcircle of triangle $BDL$ by $\omega$. Let $\omega$ meet $\Omega$ again at $P \neq B$. Prove that the line tangent to $\omega$ at $P$ meets line $BS$ on the internal angle bisector of $\angle BAC$. Well, here's my proof, but I would rather call this my rough work tbh. There are comments in the end! Proof Define $A'$ as the antipode of $A$. And redefine $P=A'D\cap (ABC)$. Define $L=SP\cap (PDB)$.  Claim1: $L-B-E$ collinear Proof: Note that $$\angle SCA=\angle SCB-\angle ACB=90-A/2-C.$$ So $$\angle SPA=90-A/2-C\implies \ang...

Just spam combo problems cause why not

This post is mainly for Rohan Bhaiya. He gave me/EGMO contestants a lot and lots of problems. Here are solutions to a very few of them.  To Rohan Bhaiya: I just wrote the sketch/proofs here cause why not :P. I did a few more extra problems so yeah.  I sort of sorted the problems into different sub-areas, but it's just better to try all of them! I did try some more combo problems outside this but I tried them in my tablet and worked there itself. So latexing was tough. Algorithms  "Just find the algorithm" they said and they died.  References:  Algorithms Pset by Abhay Bestrapalli Algorithms by Cody Johnson Problem1: Suppose the positive integer $n$ is odd. First Al writes the numbers $1, 2,\dots, 2n$ on the blackboard. Then he picks any two numbers $a, b$ erases them, and writes, instead, $|a - b|$. Prove that an odd number will remain at the end.  Proof: Well, we go $\mod 2$. Note that $$|a-b|\equiv a+b\mod 2\implies \text{ the final number is }1+2+\dots ...