Example 2: In this example, we are using the Contains method to check if a vertex is present in a Graph object. The Graph class is used for representing a graph and it can be found in the NuGet package library named QuickGraph.C# using QuickGraph; using QuickGraph.Algorithms.Search; Graph g = new Graph(); g.AddVertex(1); g.AddVertex(2); g.AddVertex(3); g.AddEdge(new Edge