Skip to content

Commit

Permalink
Fix input type of transitive reduction/closure algorithms.
Browse files Browse the repository at this point in the history
  • Loading branch information
gropax committed Feb 9, 2022
1 parent 53620e9 commit b733c1c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/QuikGraph/Algorithms/TransitiveClosureAlgorithm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ namespace QuikGraph.Algorithms
/// </summary>
/// <typeparam name="TVertex">Vertex type.</typeparam>
/// <typeparam name="TEdge">Edge type.</typeparam>
public class TransitiveClosureAlgorithm<TVertex, TEdge> : AlgorithmBase<BidirectionalGraph<TVertex, TEdge>>
public class TransitiveClosureAlgorithm<TVertex, TEdge> : AlgorithmBase<IEdgeListGraph<TVertex, TEdge>>
where TEdge : IEdge<TVertex>
{
/// <summary>
Expand All @@ -20,7 +20,7 @@ public class TransitiveClosureAlgorithm<TVertex, TEdge> : AlgorithmBase<Bidirect
/// <exception cref="T:System.ArgumentNullException"><paramref name="visitedGraph"/> is <see langword="null"/>.</exception>
/// <exception cref="T:System.ArgumentNullException"><paramref name="edgeFactory"/> is <see langword="null"/>.</exception>
public TransitiveClosureAlgorithm(
[NotNull] BidirectionalGraph<TVertex, TEdge> visitedGraph,
[NotNull] IEdgeListGraph<TVertex, TEdge> visitedGraph,
[NotNull] Func<TVertex, TVertex, TEdge> edgeFactory)
: base(visitedGraph)
{
Expand Down
4 changes: 2 additions & 2 deletions src/QuikGraph/Algorithms/TransitiveReductionAlgorithm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace QuikGraph.Algorithms
/// </summary>
/// <typeparam name="TVertex">Vertex type.</typeparam>
/// <typeparam name="TEdge">Edge type.</typeparam>
public class TransitiveReductionAlgorithm<TVertex, TEdge> : AlgorithmBase<BidirectionalGraph<TVertex, TEdge>>
public class TransitiveReductionAlgorithm<TVertex, TEdge> : AlgorithmBase<IEdgeListGraph<TVertex, TEdge>>
where TEdge : IEdge<TVertex>
{
/// <summary>
Expand All @@ -17,7 +17,7 @@ public class TransitiveReductionAlgorithm<TVertex, TEdge> : AlgorithmBase<Bidire
/// <param name="visitedGraph">Graph to visit.</param>
/// <exception cref="T:System.ArgumentNullException"><paramref name="visitedGraph"/> is <see langword="null"/>.</exception>
public TransitiveReductionAlgorithm(
[NotNull] BidirectionalGraph<TVertex, TEdge> visitedGraph)
[NotNull] IEdgeListGraph<TVertex, TEdge> visitedGraph)
: base(visitedGraph)
{
TransitiveReduction = new BidirectionalGraph<TVertex, TEdge>();
Expand Down
4 changes: 2 additions & 2 deletions src/QuikGraph/Extensions/AlgorithmExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1191,7 +1191,7 @@ public static double MaximumFlow<TVertex, TEdge>(
[Pure]
[NotNull]
public static BidirectionalGraph<TVertex, TEdge> ComputeTransitiveReduction<TVertex, TEdge>(
[NotNull] this BidirectionalGraph<TVertex, TEdge> graph)
[NotNull] this IEdgeListGraph<TVertex, TEdge> graph)
where TEdge : IEdge<TVertex>
{
var algorithm = new TransitiveReductionAlgorithm<TVertex, TEdge>(graph);
Expand All @@ -1212,7 +1212,7 @@ public static BidirectionalGraph<TVertex, TEdge> ComputeTransitiveReduction<TVer
[Pure]
[NotNull]
public static BidirectionalGraph<TVertex, TEdge> ComputeTransitiveClosure<TVertex, TEdge>(
[NotNull] this BidirectionalGraph<TVertex, TEdge> graph,
[NotNull] this IEdgeListGraph<TVertex, TEdge> graph,
[NotNull] Func<TVertex, TVertex, TEdge> edgeFactory)
where TEdge : IEdge<TVertex>
{
Expand Down

0 comments on commit b733c1c

Please sign in to comment.