Col-E / ExtraCollections

Extra useful collection types and utilities
MIT License
6 stars 1 forks source link

Custom collection type: Graph #5

Open Col-E opened 2 years ago

Col-E commented 2 years ago

Rough idea:

interface Graph<K, T> {
    Map<K, Vertex<T>> vertices();
}
interface Vertex<T> {
    T data();
    Set<Edge<T, this> edges();
}
interface Edge<T, V extends Vertex<T>> {
    V from();
    V to();
    boolean directed();
}