Exemplo n.º 1
0
 public void DeleteNode(Node node)
 {
     if (_nodeList.Contains(node))
     {
         _edgeList.RemoveBy(node);
         _nodeList.Remove(node);
         ResetSubNode();
     }
 }
Exemplo n.º 2
0
 public static bool giao(NodeCollection nodes1, NodeCollection nodes2)
 {
     foreach (var node in nodes2)
     {
         if (nodes1.Contains(node))
         {
             return(true);
         }
     }
     return(false);
 }
Exemplo n.º 3
0
 public static NodeCollection hieu(NodeCollection nodes1, NodeCollection nodes2)
 {
     if (nodes1.Count > nodes2.Count)
     {
         NodeCollection result = new NodeCollection();
         foreach (Node node in nodes1)
         {
             if (!nodes2.Contains(node))
             {
                 result.Add(node);
             }
         }
         if (result.Count > 0)
         {
             return(result);
         }
         else
         {
             return(null);
         }
     }
     return(null);
 }