Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cycles between two vertices in a directed graph

I know that in an undirected graph you have to have at least three vertices to form a cycle. My question is, in a directed graph, is it considered a cycle if two vertices have two edges pointing to each other?

Here is an example:

enter image description here

Is this a cyclic graph?

Related questions:

  • In an undirected graph, the simplest cycle must have 3 nodes?
  • Existence of cycle between any two vertices of graph
  • Cycles in an Undirected Graph
like image 327
Suragch Avatar asked Nov 06 '25 03:11

Suragch


1 Answers

A graph has a cycle if there is a non-empty path that originates at some vertex and ends at the same vertex. In your graph above, you have a cycle on path A -> C -> A. Similarly, let's imagine a directed graph with 2 vertices A and B and 2 edges AB and BA (where the first letter is the source vertex). This means that there is a cycle A -> B -> A, thus you can have a cycle in a directed graph of 2 vertices.

like image 77
Nick Clark Avatar answered Nov 09 '25 09:11

Nick Clark



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!