Hey TeX Stack Exchangers,

I have to draw some really basic undirected graphs in TikZ and struggling to find documentation that fits my needs. Each of my graphs has 10 edges and an equal number of degrees per vertice. I want to draw 3 graphs as follows:

  1. A graph with 20 nodes each with a degree of 1
  2. A graph with 10 nodes each with a degree of 2
  3. A graph with 5 nodes each with a degree of 4

I obviously don't want to hand code all of these nodes and edges. I've been playing around with loops in TikZ but it is really frustrating. The closest thing I found for graph #2 is this link but it isn't much help.


  • Thanks @HarishKumar! Turns out my problems are solved easily with tkz-berge. One of the hardest things about starting out with LaTeX is knowing what things are called in order to look them up. – plast Sep 25 '15 at 13:34

With a special package for graphs it is easy:









See documentation of tkz-berge.

enter image description here

  • Wow thanks I didn't know this package existed. I will definitely dive in! – plast Sep 25 '15 at 13:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.