CS230 Lab: Directed Graphs (DiGraphs)

Lab: Directed Graphs (DiGraphs)

Goals

  • review and use Java's Vector and LinkedList classes
  • finish the DiGraph (Directed graph) interface implementation

    [START PRELAB ] Task 0: Write the AdjListsGraphFromFile() methos

    Download the AdjListsDiGraph file you submitted with your partner for last lab. Write the static AdjListsGraphFromFile() method, which takes as an input the name of a file, in tgf format, and returns an instance of an AdjListsDiGraph. We will test it first thing in lab.

    [END of PRELAB ]

    Task 1: Test the AdjListsGraphFromFile() method written in pre-lab

    Together with your partner, decide on which of your two AdjListsDiGraph files (that you submitted for prelab) you will want to expand today. Download it as well as the starter code (includes the DiGraph interface and a folder of tgf+graphs) and then test the method extensively. Think carefully, what kinds of graphs should you test on to make sure this method works appropriately?

    Task 2: Write the AdjListsDiGraph class

    Finish the implementation of AdjListsDiGraph. As a reminder, this class has to implement the DiGraph interface, and we are also using this class to help us create a graph from a file in a tgf format, or save a graph into a tgf format.

    Task 3: Extensive testing

    Congratulations, you now have a complete implementation of a Directed Graph! While you probably did a little bit of testing for every method as you moved along, this is the moment to make sure your implementation is foolproof. Generate an exhaustive testing sequence. Think of what kind of graph should you be testing each method on.

    Interesting fact: Employers (academia and industry) say that testing tends to be one of the issues college graduates lack the most.