public bool RemoveVertex(char vertex) { int vertexPos = AdjancecyVerticesList.IndexOf(vertex); AdjancecyVerticesList.Remove(vertex); AdjancecyVerticesList.Insert(vertexPos, '-'); RemoveEdge(vertexPos); return(false); }
public bool AddVertex(char vertex) { if (AdjancecyVerticesList == null) { throw new Exception("Graph is not initialized"); } AdjancecyVerticesList.Add(vertex); return(true); }
//============================================================================================================================================================================================= public bool AddUnWightedEdge(char vertex1, char vertex2) { if (IsWeightedGraph == true) { throw new Exception("Created Graph is Weighted, Use this function only for Unweighted graph operations."); } int vertex1Pos = AdjancecyVerticesList.IndexOf(vertex1); int vertex2Pos = AdjancecyVerticesList.IndexOf(vertex2); AdjancencyMatrix[vertex1Pos, vertex2Pos] = 1; return(false); }