Beispiel #1
0
 /// <summary>
 /// Is Bounded (digraph)
 /// </summary>
 /// <param name="vx"></param>
 /// <param name="vy"></param>
 /// <returns></returns>
 bool is_bounded(Vertice vx, Vertice vy)
 {
     foreach (var aresta in grafo.Arestas)
     {
         if (grafo.isDigraph)
         {
             if (aresta.vertice1._id == vx._id && aresta.vertice2._id == vy._id)
             {
                 return(true);
             }
         }
         else
         {
             if ((aresta.vertice1._id == vx._id && aresta.vertice2._id == vy._id) ||
                 (aresta.vertice1._id == vy._id && aresta.vertice2._id == vx._id))
             {
                 return(true);
             }
         }
     }
     return(false);
 }
Beispiel #2
0
 public bool Contains(Vertice v)
 {
     return(vertice1.Equals(v) || vertice2.Equals(v));
 }
Beispiel #3
0
 /// <summary>
 /// Get all neighborhoods of an vertex
 /// </summary>
 /// <param name="v"></param>
 /// <returns></returns>
 public List <int> get_Adj(Vertice v)
 {
     return(Adj[v._id]);
 }
Beispiel #4
0
 /// <summary>
 /// Removes Vertice from Grafo.
 /// </summary>
 /// <param name="v"></param>
 public void RemoveVertice(Vertice v)
 {
     Adj.Clear_adj(v, this);
     Vertices.Remove(v);
 }
Beispiel #5
0
 /// <summary>
 /// Adds Vertice into Grafo.
 /// </summary>
 /// <param name="v"></param>
 public void AddVertice(Vertice v)
 {
     Vertices.Add(v);
     Adj.Update(this);
 }
Beispiel #6
0
 /// <summary>
 /// Removes Vertice from Grafo.
 /// </summary>
 /// <param name="v"></param>
 public void RemoveVertice(Vertice v)
 {
     Vertices.Remove(v);
 }
Beispiel #7
0
 /// <summary>
 /// Adds Vertice into Grafo.
 /// </summary>
 /// <param name="v"></param>
 public void AddVertice(Vertice v)
 {
     Vertices.Add(v);
 }