Skip to content

Graph library that defines container template classes to study graphs and related algorithms in C++

Notifications You must be signed in to change notification settings

Karanraj06/graph-template-library

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Graph-Template-Library

Defines container template classes to study graphs in C++

Summary

  • Graph template library to study graphs in C++

  • Generic graph library

  • Defines several container template classes

  • Data structures for graphs, digraphs and weighted graphs

  • Many standard graph algorithms

  • Nodes can be arbitrary objects

Example

Finds number of connected components in an undirected graph

#include <iostream>
#include "graph.h"

int main() {
    graph<char> g;
    g.add_edge('a', 'b');
    g.add_edge('c', 'd');
    g.add_edge('d', 'e');
    g.add_edge('f', 'g');

    std::cout << "Number of connected components in g are " << g.number_of_connected_components() << "\n";
    return 0;
}

Output

Number of connected components in g are 3

About

Graph library that defines container template classes to study graphs and related algorithms in C++

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages