├── .gitattributes
├── .gitignore
├── README.md
├── build
└── QuickGraphCore.nuspec
└── src
├── NuGetLogo32x32.png
├── NuGetLogo50x50.png
├── QuickGraph.sln
├── QuickGraph
├── AdjacencyGraph.cs
├── Algorithms
│ ├── AlgorithmBase.cs
│ ├── AlgorithmEventHandler.cs
│ ├── AlgorithmExtensions.cs
│ ├── CentralityApproximationAlgorithm.cs
│ ├── Cliques
│ │ ├── BronKerboshMaximumCliqueAlgorithm.cs
│ │ ├── MaximumCliqueAlgorithmBase.cs
│ │ └── ncliques.pdf
│ ├── ComputationState.cs
│ ├── Condensation
│ │ ├── CondensationGraphAlgorithm.cs
│ │ ├── CondensedEdge.cs
│ │ ├── EdgeMergeCondensationGraphAlgorithm.cs
│ │ └── MergedEdge.cs
│ ├── ConnectedComponents
│ │ ├── ConnectedComponentsAlgorithm.cs
│ │ ├── IncrementalConnectedComponentsAlgorithm.cs
│ │ ├── StronglyConnectedComponentAlgorithm.cs
│ │ └── WeaklyConnectedComponentsAlgorithm.cs
│ ├── Contracts
│ │ ├── IAlgorithmContract.cs
│ │ └── IComputationContract.cs
│ ├── DistanceRelaxers.cs
│ ├── EulerianTrailAlgorithm.cs
│ ├── Exploration
│ │ ├── CloneableVertexGraphExplorerAlgorithm.cs
│ │ ├── ITransitionFactory.cs
│ │ └── TransitionFactoryImplicitGraph.cs
│ ├── IAlgorithm.cs
│ ├── IComputation.cs
│ ├── IConnectedComponentAlgorithm.cs
│ ├── IDistanceRecorderAlgorithm.cs
│ ├── IDistanceRelaxer.cs
│ ├── IEdgeColorizerAlgorithm.cs
│ ├── IEdgePredecessorRecorderAlgorithm.cs
│ ├── IEndPathEdgeRecorderAlgorithm.cs
│ ├── ITreeBuilderAlgorithm.cs
│ ├── IUndirectedTreeBuilderAlgorithm.cs
│ ├── IUndirectedVertexPredecessorRecorderAlgorithm.cs
│ ├── IVertexColorizerAlgorithm.cs
│ ├── IVertexPredecessorRecorderAlgorithm.cs
│ ├── IVertexTimeStamperAlgorithm.cs
│ ├── LengauerTarjanDominatorAlgorithm.cs
│ ├── MaximumBipartiteMatchingAlgorithm.cs
│ ├── MaximumFlow
│ │ ├── AllVerticesGraphAugmentorAlgorithm.cs
│ │ ├── BipartiteToMaximumFlowGraphAugmentorAlgorithm.cs
│ │ ├── EdmondsKarpMaximumFlowAlgorithm.cs
│ │ ├── GraphAugmentorAlgorithmBase.cs
│ │ ├── GraphBalancingAlgorithm.cs
│ │ ├── MaximumFlowAlgorithmBase.cs
│ │ ├── MultiSourceSinkGraphAugmentorAlgorithm.cs
│ │ └── ReverseEdgeAugmentorAlgorithm.cs
│ ├── MinimumSpanningTree
│ │ ├── IMinimumSpanningTreeAlgorithm.cs
│ │ └── KruskalMinimumSpanningTreeAlgorithm.cs
│ ├── Observers
│ │ ├── Contracts
│ │ │ └── IObserverContract.cs
│ │ ├── DisposableAction.cs
│ │ ├── EdgePredecessorRecorderObserver.cs
│ │ ├── EdgeRecorderObserver.cs
│ │ ├── IObserver.cs
│ │ ├── UndirectedVertexDistanceRecorderObserver.cs
│ │ ├── UndirectedVertexPredecessorRecorderObserver.cs
│ │ ├── VertexDistanceRecorderObserver.cs
│ │ ├── VertexPredecessorPathRecorderObserver.cs
│ │ ├── VertexPredecessorRecorderObserver.cs
│ │ ├── VertexRecorderObserver.cs
│ │ └── VertexTimeStamperObserver.cs
│ ├── PageRankAlgorithm.cs
│ ├── RandomGraphFactory.cs
│ ├── RandomWalks
│ │ ├── CyclePoppingRandomTreeAlgorithm.cs
│ │ ├── IEdgeChain.cs
│ │ ├── IMarkovEdgeChain.cs
│ │ ├── MarkovEdgeChainBase.cs
│ │ ├── NormalizedMarkovEdgeChain.cs
│ │ ├── RandomWalkAlgorithm.cs
│ │ ├── RoundRobinEdgeChain.cs
│ │ ├── VanishingWeightedMarkovEdgeChain.cs
│ │ ├── WeightedMarkedEdgeChain.cs
│ │ └── WeightedMarkovEdgeChainBase.cs
│ ├── RankedShortestPath
│ │ ├── HoffmanPavleyRankedShortestPathAlgorithm.cs
│ │ └── RankedShortestPathAlgorithmBase.cs
│ ├── RootedAlgorithmBase.cs
│ ├── RootedSearchAlgorithmBase.cs
│ ├── Search
│ │ ├── BestFirstFrontierSearchAlgorithm.cs
│ │ ├── BidirectionalDepthFirstSearchAlgorithm.cs
│ │ ├── BreadthFirstSearchAlgorithm.cs
│ │ ├── DepthFirstSearchAlgorithm.cs
│ │ ├── EdgeDepthFirstSearchAlgorithm.cs
│ │ ├── HeightFirstSearchAlgorithm.cs
│ │ ├── ImplicitDepthFirstSearchAlgorithm.cs
│ │ ├── ImplicitEdgeDepthFirstSearchAlgorithm.cs
│ │ ├── UndirectedBreathFirstSearchAlgorithm.cs
│ │ ├── UndirectedDepthFirstSearchAlgorithm.cs
│ │ └── UndirectedEdgeDepthFirstSearchAlgorithm.cs
│ ├── Services
│ │ ├── IAlgorithmComponent.cs
│ │ ├── IAlgorithmServices.cs
│ │ ├── ICancelManager.cs
│ │ └── IService.cs
│ ├── ShortestPath
│ │ ├── AStartShortestPathAlgorithm.cs
│ │ ├── BellmanFordShortestPathAlgorithm.cs
│ │ ├── DagShortestPathAlgorithm.cs
│ │ ├── DijkstraShortestPathAlgorithm.cs
│ │ ├── FloydWarshallAllShortestPathAlgorithm.cs
│ │ ├── ShortestPathAlgorithmBase.cs
│ │ ├── UndirectedDijkstraShortestPathAlgorithm.cs
│ │ └── UndirectedShortestPathAlgorithmBase.cs
│ ├── TarjanOfflineLeastCommonAncestorAlgorithm.cs
│ └── TopologicalSort
│ │ ├── SourceFirstTopologicalSortAlgorithm.cs
│ │ ├── TopologicalSortAlgorithm.cs
│ │ ├── UndirectedFirstTopologicalSortAlgorithm.cs
│ │ └── UndirectedTopologicalSortAlgorithm.cs
├── ArrayAdjacencyGraph.cs
├── ArrayBidirectionalGraph.cs
├── ArrayUndirectedGraph.cs
├── BidirectionAdapterGraph.cs
├── BidirectionalGraph.cs
├── BidirectionalMatrixGraph.cs
├── Collections
│ ├── BinaryHeap.cs
│ ├── BinaryQueue.cs
│ ├── EdgeEdgeDictionary.cs
│ ├── EdgeList.cs
│ ├── FibonacciHeap.cs
│ ├── FibonacciQueue.cs
│ ├── ForestDisjointSet.cs
│ ├── IDisjointSet.cs
│ ├── IEdgeList.cs
│ ├── IPriorityQueue.cs
│ ├── IQueue.cs
│ ├── IVertexEdgeDictionary.cs
│ ├── Queue.cs
│ ├── SoftHeap.cs
│ ├── VertexEdgeDictionary.cs
│ └── VertexList.cs
├── CompressedSparseRowGraph.cs
├── Contracts
│ ├── Collections
│ │ ├── IDisjointSetContract.cs
│ │ ├── IEdgeListContract.cs
│ │ └── IVertexEdgeDictionaryContract.cs
│ ├── DummyContract.cs
│ ├── EnumerableContract.cs
│ ├── GraphContract.cs
│ ├── IBidirectionalGraphContract.cs
│ ├── IBidirectionalIncidenceGraphContract.cs
│ ├── ICloneableEdgeContract.cs
│ ├── IEdgeContract.cs
│ ├── IEdgeListGraphContract.cs
│ ├── IEdgeSetContract.cs
│ ├── IGraphContract.cs
│ ├── IImplicitGraphContract.cs
│ ├── IImplicitUndirectedGraphContract.cs
│ ├── IImplicitVertexSetContract.cs
│ ├── IIncidenceGraphContract.cs
│ ├── IMutableBidirectionalGraphContract.cs
│ ├── IMutableEdgeListGraphContract.cs
│ ├── IMutableGraphContract.cs
│ ├── IMutableIncidenceGraphContract.cs
│ ├── IMutableUndirectedGraphContract.cs
│ ├── IMutableVertexAndEdgeSetContract.cs
│ ├── IMutableVertexListGraphContract.cs
│ ├── IMutableVertexSetContract.cs
│ ├── IUndirectedEdgeContract.cs
│ ├── IUndirectedGraphContract.cs
│ └── IVertexSetContract.cs
├── CreateEdgeDelegate.cs
├── CreateVertexDelegate.cs
├── DelegateBidirectionalIncidenceGraph.cs
├── DelegateImplicitGraph.cs
├── DelegateImplicitUndirectedGraph.cs
├── DelegateIncidenceGraph.cs
├── DelegateUndirectedGraph.cs
├── DelegateVertexAndEdgeListGraph.cs
├── Diagrams
│ └── TraversalInterfaces.cd
├── Edge.cs
├── EdgeEdgeEventArgs.cs
├── EdgeEventArgs.cs
├── EdgeExtensions.cs
├── EdgeFactory.cs
├── EdgeIdentity.cs
├── EdgeListGraph.cs
├── EdgePredicate.cs
├── EquatableEdge.cs
├── FuncDelegates.cs
├── GraphColor.cs
├── GraphExtensions.cs
├── HashCodeHelper.cs
├── IBidirectionalGraph.cs
├── IBidirectionalIncidenceGraph.cs
├── ICloneableEdge.cs
├── IEdge.cs
├── IEdgeListAndIncidenceGraph.cs
├── IEdgeListGraph.cs
├── IEdgeSet.cs
├── IGraph.cs
├── IHierarchy.cs
├── IHyperEdge.cs
├── IImplicitGraph.cs
├── IImplicitUndirectedGraph.cs
├── IImplicitVertexSet.cs
├── IIncidenceGraph.cs
├── IMutableBidirectionalGraph.cs
├── IMutableEdgeListGraph.cs
├── IMutableGraph.cs
├── IMutableIncidenceGraph.cs
├── IMutableUndirectedGraph.cs
├── IMutableVertexAndEdgeListGraph.cs
├── IMutableVertexAndEdgeSet.cs
├── IMutableVertexListGraph.cs
├── IMutableVertexSet.cs
├── ITagged.cs
├── IUndirectedEdge.cs
├── IUndirectedGraph.cs
├── IVertexAndEdgeListGraph.cs
├── IVertexListGraph.cs
├── IVertexSet.cs
├── IdentifiableEdgeFactory.cs
├── IdentifiableVertexFactory.cs
├── NegativeCycleGraphException.cs
├── NegativeWeightException.cs
├── NonAcyclicGraphException.cs
├── NonStronglyConnectedGraphException.cs
├── ParallelEdgeNotAllowedException.cs
├── Predicates
│ ├── FilteredBidirectionalGraph.cs
│ ├── FilteredEdgeListGraph.cs
│ ├── FilteredGraph.cs
│ ├── FilteredImplicitGraph.cs
│ ├── FilteredImplicitVertexSetGraph.cs
│ ├── FilteredIncidenceGraph.cs
│ ├── FilteredUndirectedGraph.cs
│ ├── FilteredVertexAndEdgeListGraph.cs
│ ├── FilteredVertexListGraph.cs
│ ├── InDictionaryVertexPredicate.cs
│ ├── IsolatedVertexPredicate.cs
│ ├── ResidualEdgePrediate.cs
│ ├── ReversedResidualEdgePredicate.cs
│ └── SinkVertexPredicate.cs
├── QuickGraph.csproj
├── QuickGraphException.cs
├── ReversedBidirectionalListGraph.cs
├── SEdge.cs
├── SEquatableEdge.cs
├── SEquatableUndirectedEdge.cs
├── SReversedEdge.cs
├── STaggedEdge.cs
├── STaggedEquatableEdge.cs
├── STaggedUndirectedEdge.cs
├── SUndirectedEdge.cs
├── TaggedEdge.cs
├── TaggedEquatableEdge.cs
├── TaggedUndirectedEdge.cs
├── TryFuncDelegates.cs
├── UndirectedBidirectionalGraph.cs
├── UndirectedEdge.cs
├── UndirectedEdgeEventArgs.cs
├── UndirectedGraph.cs
├── VertexEventArgs.cs
├── VertexFactory.cs
├── VertexIdentity.cs
├── VertexIndexer.cs
├── VertexPredicate.cs
├── quickgraph.banner.png
└── quickgraph.png
└── Tests
└── QuickGraph_Tests_01
├── London_Underground_Test.cs
└── QuickGraph_Tests_01.csproj
/.gitattributes:
--------------------------------------------------------------------------------
1 | ###############################################################################
2 | # Set default behavior to automatically normalize line endings.
3 | ###############################################################################
4 | * text=auto
5 |
6 | ###############################################################################
7 | # Set default behavior for command prompt diff.
8 | #
9 | # This is need for earlier builds of msysgit that does not have it on by
10 | # default for csharp files.
11 | # Note: This is only used by command line
12 | ###############################################################################
13 | #*.cs diff=csharp
14 |
15 | ###############################################################################
16 | # Set the merge driver for project and solution files
17 | #
18 | # Merging from the command prompt will add diff markers to the files if there
19 | # are conflicts (Merging from VS is not affected by the settings below, in VS
20 | # the diff markers are never inserted). Diff markers may cause the following
21 | # file extensions to fail to load in VS. An alternative would be to treat
22 | # these files as binary and thus will always conflict and require user
23 | # intervention with every merge. To do so, just uncomment the entries below
24 | ###############################################################################
25 | #*.sln merge=binary
26 | #*.csproj merge=binary
27 | #*.vbproj merge=binary
28 | #*.vcxproj merge=binary
29 | #*.vcproj merge=binary
30 | #*.dbproj merge=binary
31 | #*.fsproj merge=binary
32 | #*.lsproj merge=binary
33 | #*.wixproj merge=binary
34 | #*.modelproj merge=binary
35 | #*.sqlproj merge=binary
36 | #*.wwaproj merge=binary
37 |
38 | ###############################################################################
39 | # behavior for image files
40 | #
41 | # image files are treated as binary by default.
42 | ###############################################################################
43 | #*.jpg binary
44 | #*.png binary
45 | #*.gif binary
46 |
47 | ###############################################################################
48 | # diff behavior for common document formats
49 | #
50 | # Convert binary document formats to text before diffing them. This feature
51 | # is only available from the command line. Turn it on by uncommenting the
52 | # entries below.
53 | ###############################################################################
54 | #*.doc diff=astextplain
55 | #*.DOC diff=astextplain
56 | #*.docx diff=astextplain
57 | #*.DOCX diff=astextplain
58 | #*.dot diff=astextplain
59 | #*.DOT diff=astextplain
60 | #*.pdf diff=astextplain
61 | #*.PDF diff=astextplain
62 | #*.rtf diff=astextplain
63 | #*.RTF diff=astextplain
64 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # QuickGraph
2 |
3 | fork from http://quickgraph.codeplex.com/
4 | just adding support .net core3.0 .NET Standard 2.1
5 |
6 |
--------------------------------------------------------------------------------
/build/QuickGraphCore.nuspec:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | QuickGraphCore
5 | 1.0.0
6 | mokeyish, pelikhan
7 | mokeyish, pelikhan
8 | QuickGraphCore
9 | http://quickgraph.codeplex.com/license
10 | https://nuget.org/Content/gallery/img/default-package-icon.svg
11 | https://github.com/mokeyish/QuickGraph
12 | false
13 | QuickGraph provides generic directed/undirected graph datastructures and algorithms for .Net
14 | QuickGraphCore add netstandard2.0 and net40 support.
15 | Copyright 2017
16 | algorithms graph directed undirected dfs bfs graphviz graphml data structure
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/src/NuGetLogo32x32.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mokeyish/QuickGraph/3ef664d330c41e44d272b7664ffa4a3e44b05361/src/NuGetLogo32x32.png
--------------------------------------------------------------------------------
/src/NuGetLogo50x50.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mokeyish/QuickGraph/3ef664d330c41e44d272b7664ffa4a3e44b05361/src/NuGetLogo50x50.png
--------------------------------------------------------------------------------
/src/QuickGraph.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio Version 16
4 | VisualStudioVersion = 16.0.29123.89
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "QuickGraph", "QuickGraph\QuickGraph.csproj", "{14156EF3-3119-436C-A590-5499C8EA7CE2}"
7 | EndProject
8 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{1A3D8E58-90CB-4767-ADB4-BDDFE86C287B}"
9 | ProjectSection(SolutionItems) = preProject
10 | NuGetLogo32x32.png = NuGetLogo32x32.png
11 | NuGetLogo50x50.png = NuGetLogo50x50.png
12 | EndProjectSection
13 | EndProject
14 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{617A3844-7708-452D-AE31-D93C6186C27B}"
15 | EndProject
16 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "QuickGraph_Tests_01", "Tests\QuickGraph_Tests_01\QuickGraph_Tests_01.csproj", "{DE8C1154-D1B6-44D9-9F6D-2DA75E8EA834}"
17 | EndProject
18 | Global
19 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
20 | Debug|Any CPU = Debug|Any CPU
21 | Release|Any CPU = Release|Any CPU
22 | EndGlobalSection
23 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
24 | {14156EF3-3119-436C-A590-5499C8EA7CE2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
25 | {14156EF3-3119-436C-A590-5499C8EA7CE2}.Debug|Any CPU.Build.0 = Debug|Any CPU
26 | {14156EF3-3119-436C-A590-5499C8EA7CE2}.Release|Any CPU.ActiveCfg = Release|Any CPU
27 | {14156EF3-3119-436C-A590-5499C8EA7CE2}.Release|Any CPU.Build.0 = Release|Any CPU
28 | {DE8C1154-D1B6-44D9-9F6D-2DA75E8EA834}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
29 | {DE8C1154-D1B6-44D9-9F6D-2DA75E8EA834}.Debug|Any CPU.Build.0 = Debug|Any CPU
30 | {DE8C1154-D1B6-44D9-9F6D-2DA75E8EA834}.Release|Any CPU.ActiveCfg = Release|Any CPU
31 | {DE8C1154-D1B6-44D9-9F6D-2DA75E8EA834}.Release|Any CPU.Build.0 = Release|Any CPU
32 | EndGlobalSection
33 | GlobalSection(SolutionProperties) = preSolution
34 | HideSolutionNode = FALSE
35 | EndGlobalSection
36 | GlobalSection(NestedProjects) = preSolution
37 | {14156EF3-3119-436C-A590-5499C8EA7CE2} = {1A3D8E58-90CB-4767-ADB4-BDDFE86C287B}
38 | {DE8C1154-D1B6-44D9-9F6D-2DA75E8EA834} = {617A3844-7708-452D-AE31-D93C6186C27B}
39 | EndGlobalSection
40 | GlobalSection(ExtensibilityGlobals) = postSolution
41 | SolutionGuid = {D3DF0295-12D1-4CA8-9E52-AF9646E56126}
42 | EndGlobalSection
43 | EndGlobal
44 |
--------------------------------------------------------------------------------
/src/QuickGraph/Algorithms/AlgorithmEventHandler.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 |
5 | namespace QuickGraph.Algorithms
6 | {
7 | public delegate void AlgorithmEventHandler(
8 | IAlgorithm sender,
9 | EventArgs e);
10 | }
11 |
--------------------------------------------------------------------------------
/src/QuickGraph/Algorithms/Cliques/BronKerboshMaximumCliqueAlgorithm.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using QuickGraph.Algorithms.Services;
6 |
7 | namespace QuickGraph.Algorithms.Cliques
8 | {
9 | // under construction
10 | class BronKerboshMaximumCliqueAlgorithm
11 | : MaximumCliqueAlgorithmBase
12 | where TEdge : IEdge
13 | {
14 | protected BronKerboshMaximumCliqueAlgorithm(
15 | IAlgorithmComponent host,
16 | IUndirectedGraph visitedGraph)
17 | : base(host, visitedGraph)
18 | {}
19 |
20 | protected BronKerboshMaximumCliqueAlgorithm(
21 | IUndirectedGraph visitedGraph)
22 | : base(visitedGraph)
23 | {}
24 |
25 | protected override void InternalCompute()
26 | {
27 | // the currently growing clique;
28 | var R = new List();
29 | // prospective nodes which are connected to all nodes in R
30 | // and using which R can be expanded
31 | var P = new List();
32 | // nodes already processed i.e. nodes which were previously in P
33 | // and hence all maximal cliques containing them have already been reported
34 | var X = new List();
35 |
36 | // An important invariant is that all nodes which are connected to every node
37 | // of R are either in P or X.
38 |
39 | }
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/src/QuickGraph/Algorithms/Cliques/MaximumCliqueAlgorithmBase.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using QuickGraph.Algorithms.Services;
6 |
7 | namespace QuickGraph.Algorithms.Cliques
8 | {
9 | public abstract class MaximumCliqueAlgorithmBase
10 | : AlgorithmBase>
11 | where TEdge : IEdge
12 | {
13 | protected MaximumCliqueAlgorithmBase(IAlgorithmComponent host, IUndirectedGraph visitedGraph)
14 | : base(host, visitedGraph)
15 | {}
16 |
17 | protected MaximumCliqueAlgorithmBase(IUndirectedGraph visitedGraph)
18 | : base(visitedGraph)
19 | {}
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/src/QuickGraph/Algorithms/Cliques/ncliques.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mokeyish/QuickGraph/3ef664d330c41e44d272b7664ffa4a3e44b05361/src/QuickGraph/Algorithms/Cliques/ncliques.pdf
--------------------------------------------------------------------------------
/src/QuickGraph/Algorithms/ComputationState.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace QuickGraph.Algorithms
4 | {
5 | ///
6 | /// The computation state of a graph algorithm
7 | ///
8 | [Serializable]
9 | public enum ComputationState
10 | {
11 | ///
12 | /// The algorithm is not running
13 | ///
14 | NotRunning,
15 | ///
16 | /// The algorithm is running
17 | ///
18 | Running,
19 | ///
20 | /// An abort has been requested. The algorithm is still running and will cancel as soon as it checks
21 | /// the cancelation state
22 | ///
23 | PendingAbortion,
24 | ///
25 | /// The computation is finished succesfully.
26 | ///
27 | Finished,
28 | ///
29 | /// The computation was aborted
30 | ///
31 | Aborted
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/src/QuickGraph/Algorithms/Condensation/CondensedEdge.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using QuickGraph.Collections;
4 |
5 | namespace QuickGraph.Algorithms.Condensation
6 | {
7 | [Serializable]
8 | public sealed class CondensedEdge : Edge
9 | where TEdge : IEdge
10 | where TGraph : IMutableVertexAndEdgeSet, new()
11 | {
12 | private List edges = new List();
13 | public CondensedEdge(TGraph source, TGraph target)
14 | :base(source,target)
15 | { }
16 |
17 | public IList Edges
18 | {
19 | get { return this.edges; }
20 | }
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/src/QuickGraph/Algorithms/Condensation/MergedEdge.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using QuickGraph.Collections;
4 |
5 | namespace QuickGraph.Algorithms.Condensation
6 | {
7 | [Serializable]
8 | public sealed class MergedEdge : Edge
9 | where TEdge : IEdge
10 | {
11 | private List edges = new List();
12 |
13 | public MergedEdge(TVertex source, TVertex target)
14 | :base(source,target)
15 | { }
16 |
17 | public IList Edges
18 | {
19 | get { return this.edges; }
20 | }
21 |
22 | public static MergedEdge Merge(
23 | MergedEdge inEdge,
24 | MergedEdge outEdge
25 | )
26 | {
27 | MergedEdge newEdge = new MergedEdge(
28 | inEdge.Source, outEdge.Target);
29 | newEdge.edges = new List(inEdge.Edges.Count + outEdge.Edges.Count);
30 | newEdge.edges.AddRange(inEdge.Edges);
31 | newEdge.edges.AddRange(outEdge.edges);
32 |
33 | return newEdge;
34 | }
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/src/QuickGraph/Algorithms/Contracts/IAlgorithmContract.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Diagnostics.Contracts;
6 |
7 | namespace QuickGraph.Algorithms.Contracts
8 | {
9 | [ContractClassFor(typeof(IAlgorithm<>))]
10 | abstract class IAlgorithmContract
11 | : IAlgorithm
12 | {
13 | #region IAlgorithm Members
14 |
15 | TGraph IAlgorithm.VisitedGraph
16 | {
17 | get
18 | {
19 | Contract.Ensures(Contract.Result() != null);
20 |
21 | return default(TGraph);
22 | }
23 | }
24 |
25 | #endregion
26 |
27 | #region IComputation Members
28 |
29 | object IComputation.SyncRoot
30 | {
31 | get { throw new NotImplementedException(); }
32 | }
33 |
34 | ComputationState IComputation.State
35 | {
36 | get { throw new NotImplementedException(); }
37 | }
38 |
39 | void IComputation.Compute()
40 | {
41 | throw new NotImplementedException();
42 | }
43 |
44 | void IComputation.Abort()
45 | {
46 | throw new NotImplementedException();
47 | }
48 |
49 | event EventHandler IComputation.StateChanged
50 | {
51 | add { throw new NotImplementedException(); }
52 | remove { throw new NotImplementedException(); }
53 | }
54 |
55 | event EventHandler IComputation.Started
56 | {
57 | add { throw new NotImplementedException(); }
58 | remove { throw new NotImplementedException(); }
59 | }
60 |
61 | event EventHandler IComputation.Finished
62 | {
63 | add { throw new NotImplementedException(); }
64 | remove { throw new NotImplementedException(); }
65 | }
66 |
67 | event EventHandler IComputation.Aborted
68 | {
69 | add { throw new NotImplementedException(); }
70 | remove { throw new NotImplementedException(); }
71 | }
72 |
73 | #endregion
74 | }
75 | }
--------------------------------------------------------------------------------
/src/QuickGraph/Algorithms/Contracts/IComputationContract.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Diagnostics.Contracts;
3 |
4 | namespace QuickGraph.Algorithms.Contracts
5 | {
6 | [ContractClassFor(typeof(IComputation))]
7 | abstract class IComputationContract
8 | : IComputation
9 | {
10 | #region IComputation Members
11 | object IComputation.SyncRoot
12 | {
13 | get
14 | {
15 | Contract.Ensures(Contract.Result