Skip to content

Commit 319ec30

Browse files
authored
Merge pull request #14 from matiii/feature/net-support
Feature/net support
2 parents 2c88875 + cee50b1 commit 319ec30

File tree

6 files changed

+155
-4
lines changed

6 files changed

+155
-4
lines changed

src/Dijkstra.NET.sln

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,18 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
33
# Visual Studio 15
4-
VisualStudioVersion = 15.0.26730.12
4+
VisualStudioVersion = 15.0.27004.2010
55
MinimumVisualStudioVersion = 10.0.40219.1
6-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Dijkstra.NET", "Dijkstra.NET\Dijkstra.NET.csproj", "{2D42C275-6A10-4AC9-BBCF-1483FEB68B04}"
6+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Dijkstra.NET", "Dijkstra.NET\Dijkstra.NET.csproj", "{2D42C275-6A10-4AC9-BBCF-1483FEB68B04}"
77
EndProject
88
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Dijkstra.NET.Tests", "Dijkstra.NET.Tests\Dijkstra.NET.Tests.csproj", "{70A4E3BB-08CC-4105-B753-A176CA8ACCD4}"
99
EndProject
1010
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Dijkstra.NET.Benchmark", "Dijkstra.NET.Benchmark\Dijkstra.NET.Benchmark.csproj", "{FD137CCE-DB20-4C6A-ABBB-6E853994DB29}"
1111
EndProject
12+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Samples", "Samples", "{20A0B105-1344-4E76-B1E9-442217A527C0}"
13+
EndProject
14+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Dijkstra.Net40", "Samples\Dijkstra.Net40\Dijkstra.Net40.csproj", "{6DBC26CB-148B-48CE-8B24-3177541C83E7}"
15+
EndProject
1216
Global
1317
GlobalSection(SolutionConfigurationPlatforms) = preSolution
1418
Debug|Any CPU = Debug|Any CPU
@@ -27,10 +31,17 @@ Global
2731
{FD137CCE-DB20-4C6A-ABBB-6E853994DB29}.Debug|Any CPU.Build.0 = Debug|Any CPU
2832
{FD137CCE-DB20-4C6A-ABBB-6E853994DB29}.Release|Any CPU.ActiveCfg = Release|Any CPU
2933
{FD137CCE-DB20-4C6A-ABBB-6E853994DB29}.Release|Any CPU.Build.0 = Release|Any CPU
34+
{6DBC26CB-148B-48CE-8B24-3177541C83E7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
35+
{6DBC26CB-148B-48CE-8B24-3177541C83E7}.Debug|Any CPU.Build.0 = Debug|Any CPU
36+
{6DBC26CB-148B-48CE-8B24-3177541C83E7}.Release|Any CPU.ActiveCfg = Release|Any CPU
37+
{6DBC26CB-148B-48CE-8B24-3177541C83E7}.Release|Any CPU.Build.0 = Release|Any CPU
3038
EndGlobalSection
3139
GlobalSection(SolutionProperties) = preSolution
3240
HideSolutionNode = FALSE
3341
EndGlobalSection
42+
GlobalSection(NestedProjects) = preSolution
43+
{6DBC26CB-148B-48CE-8B24-3177541C83E7} = {20A0B105-1344-4E76-B1E9-442217A527C0}
44+
EndGlobalSection
3445
GlobalSection(ExtensibilityGlobals) = postSolution
3546
SolutionGuid = {0F4388FD-4FB5-4B5A-9CD2-923DC611107D}
3647
EndGlobalSection

src/Dijkstra.NET/Dijkstra.NET.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>netstandard1.3</TargetFramework>
5-
<Version>1.0.7</Version>
4+
<TargetFrameworks>netstandard1.3;net40</TargetFrameworks>
5+
<Version>1.0.8</Version>
66
<Authors>Mateusz Mazurek</Authors>
77
<Company />
88
<Description>High performance the shortest path in directed graph with non negative weights algorithm implementation.</Description>
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<configuration>
3+
<startup>
4+
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
5+
</startup>
6+
</configuration>
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
4+
<PropertyGroup>
5+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
7+
<ProjectGuid>{6DBC26CB-148B-48CE-8B24-3177541C83E7}</ProjectGuid>
8+
<OutputType>Exe</OutputType>
9+
<RootNamespace>Dijkstra.Net40</RootNamespace>
10+
<AssemblyName>Dijkstra.Net40</AssemblyName>
11+
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
12+
<FileAlignment>512</FileAlignment>
13+
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
14+
<TargetFrameworkProfile />
15+
</PropertyGroup>
16+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
17+
<PlatformTarget>AnyCPU</PlatformTarget>
18+
<DebugSymbols>true</DebugSymbols>
19+
<DebugType>full</DebugType>
20+
<Optimize>false</Optimize>
21+
<OutputPath>bin\Debug\</OutputPath>
22+
<DefineConstants>DEBUG;TRACE</DefineConstants>
23+
<ErrorReport>prompt</ErrorReport>
24+
<WarningLevel>4</WarningLevel>
25+
</PropertyGroup>
26+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
27+
<PlatformTarget>AnyCPU</PlatformTarget>
28+
<DebugType>pdbonly</DebugType>
29+
<Optimize>true</Optimize>
30+
<OutputPath>bin\Release\</OutputPath>
31+
<DefineConstants>TRACE</DefineConstants>
32+
<ErrorReport>prompt</ErrorReport>
33+
<WarningLevel>4</WarningLevel>
34+
</PropertyGroup>
35+
<ItemGroup>
36+
<Reference Include="System" />
37+
<Reference Include="System.Core" />
38+
<Reference Include="System.Xml.Linq" />
39+
<Reference Include="System.Data.DataSetExtensions" />
40+
<Reference Include="Microsoft.CSharp" />
41+
<Reference Include="System.Data" />
42+
<Reference Include="System.Net.Http" />
43+
<Reference Include="System.Xml" />
44+
</ItemGroup>
45+
<ItemGroup>
46+
<Compile Include="Program.cs" />
47+
<Compile Include="Properties\AssemblyInfo.cs" />
48+
</ItemGroup>
49+
<ItemGroup>
50+
<None Include="App.config" />
51+
</ItemGroup>
52+
<ItemGroup>
53+
<ProjectReference Include="..\..\Dijkstra.NET\Dijkstra.NET.csproj">
54+
<Project>{2d42c275-6a10-4ac9-bbcf-1483feb68b04}</Project>
55+
<Name>Dijkstra.NET</Name>
56+
</ProjectReference>
57+
</ItemGroup>
58+
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
59+
</Project>
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
using System;
2+
using System.Linq;
3+
using Dijkstra.NET.Contract;
4+
using Dijkstra.NET.Model;
5+
using Dijkstra.NET.ShortestPath;
6+
7+
namespace Dijkstra.Net40
8+
{
9+
class Program
10+
{
11+
static void Main(string[] args)
12+
{
13+
var graph = new Graph<int, string>();
14+
15+
graph.AddNode(1);
16+
graph.AddNode(2);
17+
18+
graph.Connect(0, 1, 5, "some custom information in edge"); //First node has key equal 0
19+
20+
var dijkstra = new Dijkstra<int, string>(graph);
21+
IShortestPathResult result = dijkstra.Process(0, 1); //result contains the shortest path
22+
23+
var path = result.GetPath();
24+
25+
graph.Reset();
26+
27+
var bfs = new BfsParallel<int, string>(graph);
28+
29+
IShortestPathResult bfsResult = bfs.Process(0, 1);
30+
31+
var bfsPath = bfsResult.GetPath();
32+
33+
if (!bfsPath.SequenceEqual(path))
34+
{
35+
throw new Exception("The path should be the same.");
36+
}
37+
}
38+
}
39+
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
using System.Reflection;
2+
using System.Runtime.CompilerServices;
3+
using System.Runtime.InteropServices;
4+
5+
// General Information about an assembly is controlled through the following
6+
// set of attributes. Change these attribute values to modify the information
7+
// associated with an assembly.
8+
[assembly: AssemblyTitle("Dijkstra.Net40")]
9+
[assembly: AssemblyDescription("")]
10+
[assembly: AssemblyConfiguration("")]
11+
[assembly: AssemblyCompany("Santander")]
12+
[assembly: AssemblyProduct("Dijkstra.Net40")]
13+
[assembly: AssemblyCopyright("Copyright © Santander 2017")]
14+
[assembly: AssemblyTrademark("")]
15+
[assembly: AssemblyCulture("")]
16+
17+
// Setting ComVisible to false makes the types in this assembly not visible
18+
// to COM components. If you need to access a type in this assembly from
19+
// COM, set the ComVisible attribute to true on that type.
20+
[assembly: ComVisible(false)]
21+
22+
// The following GUID is for the ID of the typelib if this project is exposed to COM
23+
[assembly: Guid("6dbc26cb-148b-48ce-8b24-3177541c83e7")]
24+
25+
// Version information for an assembly consists of the following four values:
26+
//
27+
// Major Version
28+
// Minor Version
29+
// Build Number
30+
// Revision
31+
//
32+
// You can specify all the values or you can default the Build and Revision Numbers
33+
// by using the '*' as shown below:
34+
// [assembly: AssemblyVersion("1.0.*")]
35+
[assembly: AssemblyVersion("1.0.0.0")]
36+
[assembly: AssemblyFileVersion("1.0.0.0")]

0 commit comments

Comments
 (0)