Simple Graphs Library for C# Applications
This library was build for the subject "Game Programming" of the Games Master on the Hamburg University of Applied Sciences.
This library contains basic datastructures that represent unweighted, non-directional Graphs with Edges and Vertices. Additionally it provides some methods to process Graphs in certain ways, like a path search algorithm or algorithms to determine the completeness or connectivity of a Graph.
Vertices are identified through strings and Edges are spanned over two Vertices.
The Graph class provides the basic data structure and is the core of the library.
You can create a Graph by using either Arrays of Vertices and Edges or Arrays of strings as identifier for the Vertices and Pairs of strings to define the Edges. When Edges contain non-existent Vertices they will be created, so most of the times you do not need to bother about providing an array of Vertices. Like in the Constructor you can provide a Vertex or a string as an argument. The new Vertex will be created and added to the Graph. Like in the Constructor you can provide either an Edge or a Pair of strings. Also the Vertices in the Edge do not have to exist. If they don't they will be created. The Edge basically is just a Pair of two Vertices. To create an Edge you can either provide two Vertices or a Pair of strings. Vertices are identified through strings. Equality will also be determined only through the string. A Vertex can be created by providing a string as an identifier. The GraphHelper-Class is a static class that provides some methods that can help analysing a Graph. Takes a Graph and a Vertex or an Edge as arguments. Finds all Edges that contain the given Vertex or one of the Vertices in the given Edge. Takes a Graph and a Vertex or an Edge as arguments. Finds all Vertices that are neighbours to the given Vertex or one of the Vertices in the given Edge. The GraphProperties-Class is a static class that provides some methods to determine specific properties of a Graph. This Class also provides all methods as asynchronous methods. Returns true when there is a path between the two Vertices. Returns true when the Graph is complete. Returns true when the Graph is bipartite. Returns true when the Graph is connected. The DijkstraSearch-Class provides path searches. Returns an array of Vertices that describe a path from one Vertex to another. The path is determined by using the Dijkstra-Search-Algorithm. Counts and returns the number of vertices that can be reached when starting from the given Vertex. This library just provides some very basic methods and data structures for graphs. Maybe in the future we will add the support of directional and weighted Graphs as well. Since this is not our main project it is not very likely.