Skip to content

Commit aef5692

Browse files
authored
Update README.md
1 parent 3849865 commit aef5692

File tree

1 file changed

+7
-24
lines changed

1 file changed

+7
-24
lines changed

README.md

Lines changed: 7 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Dijkstra.NET Dijkstra algorithm in C# [![NuGet Version](https://img.shields.io/badge/Dijkstra.NET-1.0.9-blue.svg)](https://www.nuget.org/packages/Dijkstra.NET)
1+
# Dijkstra.NET Dijkstra algorithm in C# [![NuGet Version](https://img.shields.io/badge/Dijkstra.NET-1.1.0-blue.svg)](https://www.nuget.org/packages/Dijkstra.NET)
22

33
Dijkstra algorithm which use priority queue thus complexity is equal O(ElogV) where E is number of edges and V is number of vertices. Used data structures are based on interfaces so you can implement your own or reused present. Simply example below. More information about algorithm you can find on [Wikipedia](https://en.wikipedia.org/wiki/Dijkstra%27s_algorithm).
44

@@ -23,22 +23,6 @@ graph.Connect(0, 1, 5, "some custom information in edge"); //First node has key
2323
2424
ShortestPathResult result = graph.Dijkstra(0, 1); //result contains the shortest path
2525
26-
result.GetPath();
27-
```
28-
## Parallel version - obsolete
29-
30-
Library provide parallel version of finding the shortest path in graph, it uses [breadth-first search](https://en.wikipedia.org/wiki/Breadth-first_search) algorithm and Map-Reduce technics. Parallel version use all cores to find the shortest path thus processing cost is higher than classic way, however it can gives quicker result when dense graph with similar weights was processed. Simple example below.
31-
32-
```c#
33-
var graph = new Graph<int, string>();
34-
35-
graph.AddNode(1);
36-
graph.AddNode(2);
37-
38-
graph.Connect(0, 1, 5, "some custom information in edge"); //First node has key equal 0
39-
40-
var bfs = new BfsParallel<int, string>(graph);
41-
IShortestPathResult result = bfs.Process(0, 1); //result contains the shortest path
4226
result.GetPath();
4327
```
4428

@@ -50,18 +34,17 @@ For Graph where number of nodes is 10 000 000 and connections between them 1 000
5034

5135
BenchmarkDotNet=v0.10.10, OS=Windows 7 SP1 (6.1.7601.0)
5236
Processor=Intel Core i7-6600U CPU 2.60GHz (Skylake), ProcessorCount=4
53-
Frequency=2742265 Hz, Resolution=364.6621 ns, Timer=TSC
54-
[Host] : .NET Framework 4.7 (CLR 4.0.30319.42000), 32bit LegacyJIT-v4.7.2116.0
55-
Job-XQYAYC : .NET Framework 4.7 (CLR 4.0.30319.42000), 32bit LegacyJIT-v4.7.2116.0
37+
Frequency=2742363 Hz, Resolution=364.6490 ns, Timer=TSC
38+
[Host] : .NET Framework 4.7 (CLR 4.0.30319.42000), 32bit LegacyJIT-v4.7.2563.0
39+
Job-XQYAYC : .NET Framework 4.7 (CLR 4.0.30319.42000), 32bit LegacyJIT-v4.7.2563.0
5640

5741
LaunchCount=1 RunStrategy=Monitoring TargetCount=3
5842
WarmupCount=2
5943

6044
```
61-
| Method | Mean | StdDev | Scaled | ScaledSD |
62-
|------------------ |----------:|----------:|-------:|---------:|
63-
| DijkstraBenchmark | 24.07 us | 2.188 us | 1.00 | 0.00 |
64-
| BfsBenchmark | 173.82 us | 19.673 us | 7.26 | 0.86 |
45+
| Method | Mean | Error | StdDev | Scaled | Allocated |
46+
|--------------------------- |---------:|---------:|---------:|-------:|----------:|
47+
| Dijkstra | 5.348 us | 24.43 us | 1.381 us | 1.00 | 16 KB |
6548

6649
## License
6750

0 commit comments

Comments
 (0)