Chris
Chris

Reputation: 815

Cyclical graphs

I have a question about cyclical graphs.

I understand that a simple cyclical graph is where one's edges and vertices are distinct.

Am I correct to assume that this means that no edge/vertex is visited more than once when completing a cycle? and that the opposite is for a non simple graph?

I would also like to know if having a graph with only say two vertices can be cycled through? or is there no need to cycle through a graph with two vertices?

For example: Can you cycle through this?

A <-> B

Upvotes: 2

Views: 171

Answers (1)

Konstantin Yovkov
Konstantin Yovkov

Reputation: 62854

  • If the graph is directed and is not a multigraph, e.g. A -> B, then there's no cycle, because you can only go from A to B and cannot go from B to A.
  • If the graph is а directed multigraph, e.g. A <-> B, then its not cyclic, because A would have been already visited, before you try to get back to it from B. However, if you want to find a cycle of non-visited edges, then it would be cyclic, as you would track which edges are visited.
  • If the graph is undirected, e.g. A - B, then there's no cycle, as A and B will be visited exactly once.

Upvotes: 3

Related Questions