Skip to Main Content
| Brooklyn College Library & Academic IT |CISC Department

CISC 3130 Data Structures: Graphs

Professor Chuang Spring 2020 OER

Introduction

Definition: A set of items connected by edges. Each item is called a vertex or node. Formally, a graph is a set of vertices and a binary relation between vertices, adjacency.

References

Black, Paul E. (2019-10-1). Pieterse, Vreda; Black, Paul E. (eds.). "dictionary".Dictionary of Algorithms and Data Structures. National Institute of Standards and Technology. Retrieved from: https://www.nist.gov/dads/HTML/dictionary.html

Concept

Graph Data Structure

Java Implementation

A node that features a String label.

class Node {
    String label;
    Node(String label) {
        this.label = label;
    }
}

Here's how we can implement a graph as an adjacency list.

class Graph {
    private Map> adjVertices;
}