Discrete Structures 2 - Plate #6: Representing Graphs, Graph Isomorphism and Connectivity

About

  • The common package contains the Graph class and the Vertex class, which contains common functions that can be used in problems 1-8.
  • The Plate6 package contains the Main class, which is the entrypoint of the program, and a separate class for each of the problem questions.
  • Each variable name in the Plate6 package has my surname, as required by the professor.

Problems

  1. Write a java program that receives a list of edges of a simple graph, the program should determine whether it is connected and find the number of connected components if it is not connected.
  2. Write a java program that accepts an adjacency matrix of a graph. The program should list the edges of this graph and give the number of times each edge appears.
  3. Write a java program that will determine if a graph has a cycle or not.
  4. Write a java program, given the pair of vertex associated to the edges of an undirected graph, it will output the degree of vertex.
  5. Write a java program that receives a list of edges of a simple graph and determine whether the graph is bipartite.
  6. Write a java program that receives the vertex pairs associated to the edges of a graph, the program should construct an adjacency matrix for the graph. (Produce a version that works when loops, multiple edges, or directed edges are present.)
  7. Write a java program that accepts vertex pairs associated to the edges of an undirected graph and the number of times each edge appears. The program should construct an incidence matrix for the graph.
  8. Write a Java program that checks whether two graphs are isomorphic or not, given a set of vertices.

How to Use

  • Compile the program
  • Select the problem to be answered by the program
  • Follow the steps

Author Information