/// <param name="edges">list of all the edges for the graph</param> /// <param name="graphEdgesValidationDesired">enum specifying whether or not validation is desired</param> /// <returns>an instance implementing the Graph interface</returns> public static Graph CreateGraph( IList <Edge> edges, GraphEdgesValidationDesired graphEdgesValidationDesired ) { return(new GraphImpl(edges, graphEdgesValidationDesired)); }
/// <param name="edges">list of edges</param> /// <param name="graphEdgesValidationDesired">should be NO (for performance reason) if validation has already been done</param> /// <returns>an instance of a PathFinderGenerics implementation</returns> public F CreatePathFinder( IList <E> edges, GraphEdgesValidationDesired graphEdgesValidationDesired ) { GraphGenerics <E, V, W> graph = GraphGenericsImpl <E, V, W> .CreateGraphGenerics <E, V, W>(edges, graphEdgesValidationDesired); return(CreatePathFinder(graph)); // the overloaded method must be implemented by subclasses }
private IDictionary <string, E> mapWithEdges; // lazy loaded protected GraphGenericsImpl( IList <E> edges, GraphEdgesValidationDesired graphEdgesValidationDesired ) { this.edges = new ReadOnlyCollection <E>(edges); if (graphEdgesValidationDesired == GraphEdgesValidationDesired.YES) { GraphEdgesValidator <PathGenerics <E, V, W>, E, V, W> .ValidateEdgesForGraphCreation <PathGenerics <E, V, W>, E, V, W>(this.edges); } }
public static GraphGenerics <E, V, W> CreateGraphGenerics <E, V, W>( IList <E> edges, GraphEdgesValidationDesired graphEdgesValidationDesired ) where E : EdgeGenerics <V, W> where V : Vertex where W : Weight { var g = new GraphGenericsImpl <E, V, W>( edges, graphEdgesValidationDesired ); return(g); }
private GraphImpl( IList <Edge> edges, GraphEdgesValidationDesired graphEdgesValidationDesired ) : base(edges, graphEdgesValidationDesired) { }