protected static void FilterParallelEdges <TVertexType, TEdgeType>(ISoftMutableGraph <TVertexType, TEdgeType> graph)
     where TEdgeType : class, IEdge <TVertexType>
 {
     foreach (TVertexType v in graph.Vertices)
     {
         var neighbours = new HashSet <TVertexType>();
         foreach (var e in graph.OutEdges(v).ToList())
         {
             if (!neighbours.Add(e.Target))
             {
                 //target already a neighbour, it is a parallel edge
                 graph.HideEdge(e, ParallelEdgesTag);
             }
         }
         foreach (var e in graph.InEdges(v).ToList())
         {
             if (!neighbours.Add(e.Source))
             {
                 //source already a neighbour, it is a parallel edge
                 graph.HideEdge(e, ParallelEdgesTag);
             }
         }
     }
 }
 protected static void FilterLoops <TVertexType, TEdgeType>(ISoftMutableGraph <TVertexType, TEdgeType> graph)
     where TEdgeType : class, IEdge <TVertexType>
     where TVertexType : class
 {
     graph.HideEdgesIf(e => e.Source == e.Target, LoopsTag);
 }
 protected static void FilterIsolatedVertices <TVertexType, TEdgeType>(ISoftMutableGraph <TVertexType, TEdgeType> graph)
     where TEdgeType : class, IEdge <TVertexType>
 {
     graph.HideVerticesIf(v => graph.Degree(v) == 0, IsolatedVerticesTag);
 }