QuestionQuestion

Transcribed TextTranscribed Text

Background A communications network consists of a setof switching center (vertices) and a setof communications lines (edges) that connect these centers. When designing network a communications company needs to know whether the resulting network will continue to support communications between all centers should any one of these communications lines be rendered inopera tive due to weather or equipment failure. That is. they need to know the answer to the following question. Given graph in which there is a path from everyvertex to every other vertex, will removing any edge from the graph always produce a graph in which there is stilla path from every vertex to every other vertex? Obviously, the answer to this question depends on the graph. The answer for the graph shown below is yes A B E C D On the other hand, you can divide the following graph into two disconnected subgraphs by removing the edge connecting vertices D and E. Thus. for this graph, the answeris no. A B E G D F H Although determining an answer to this question for an arbitrary graph is somewhat difficult, there are certain classes of graphs for which the answer is always yes. Give the definitions graph Gis said to be connected if there exists path from every vertex in G to every other vertex in G, The degree of vertex V in graph G is the number of edges in G that connect to V. where an edge from V to itself counts twice, the following rule can be derived using simple graph theory If all the vertices in a connected graph are of even degree, then removing any one edge from the graph will always produce a connected graph. Example of an even Degree Vertex Example of an Odd Degree Vertex If this rule applies to a graph, then you know that the answer to the previous question is yes for that graph Note that this rule tells you nothing about connected graphs in which the degree of one or more vertices is odd. Deliverables 1. Include a graph class from lecture (adjacency matrix or adjacency list). 2. Include an operation of your own that checks whether every vertex in graph is of even degree with the following prototype: public boolean areAllEven () 1....) /*post condition: returns true if every vertex in a graph is of even degree. Otherwise, returns false */ 3. Include client program that inserts data into more than one graph object and run the areAllEven() operation for each. Each graph object should have different configuration of edges and vertices. Run the program to test the areAllEven() function for both true and false results Output should indicate whether the graph is of even degree. 4. Along with your source code for this project, include documentation that demonstrates the configuration of vertices and edges in each of the graphs being used by the client program for testing. This representation maybe an image of the logical graph configurations, graph adjacency matrix or an adjacency list (choose only one). The adjacency list may optionally be produced by your program as output rather than as separate documentation, but this is not required. Examples of each of the types of representations are shown below. Example of logical graph image A B E ittp:llsriestaff.santarosa.edu/~Imeade/cs11/graph1.txt) D F Example of an adjacency matrix A B c D E F A TRUE TRUE B TRUE TRUE c TRUE TRUE D TRUE TRUE TRUE TRUE E TRUE TRUE F TRUE TRUE Example of an adjacency list A:{B, C} B: {A,D} C: {A,D} D: {B, C,E,F} E: {D,F} F: {D,E} Reminder: Provide only one of the above types of represent tations for each of the graph objects used by your client program for testing

Solution PreviewSolution Preview

These solutions may offer step-by-step problem-solving explanations or good writing examples that include modern styles of formatting and construction of bibliographies out of text citations and references. Students may use these solutions for personal skill-building and practice. Unethical use is strictly forbidden.

mport java.util.ArrayList;


public class Library {
    /*
    private attributes
    */
    private ArrayList<Book> sortedBooks;
    private ArrayList<Book> nonSortedBooks;
    private int sortedsize;
    private int dups;
   
    /**
    * Constructor of a Library object
    */
    public Library(){
       this.sortedBooks = new ArrayList<>();
       this.nonSortedBooks = new ArrayList<>();
       this.sortedsize = 0;
       this.dups = 0;
    }
   
    /**
    * Method for adding new book to the library
    * @param title Title of a book
    * @param author Author of a book
    * @param subject Subject
    * @param ISBN ISBN identifier of a book
    * @return Book object created and added to nonSortedBooks
    */
    public Book inputBook(String title, String author, String subject, String ISBN){      
       Book book = new Book(title, author, subject, ISBN);
       this.nonSortedBooks.add(book);
       return book;
    }

    /*
    Getter of sortedSize attribute
    */
    public int getSortedsize() {
       return sortedsize;
    }...

By purchasing this solution you'll be able to access the following files:
Solution.zip.

50% discount

Hours
Minutes
Seconds
$25.00 $12.50
for this solution

PayPal, G Pay, ApplePay, Amazon Pay, and all major credit cards accepted.

Find A Tutor

View available Java Programming Tutors

Get College Homework Help.

Are you sure you don't want to upload any files?

Fast tutor response requires as much info as possible.

Decision:
Upload a file
Continue without uploading

SUBMIT YOUR HOMEWORK
We couldn't find that subject.
Please select the best match from the list below.

We'll send you an email right away. If it's not in your inbox, check your spam folder.

  • 1
  • 2
  • 3
Live Chats