Skip to content

Commit e5fee10

Browse files
committed
Merging
2 parents a66aeeb + 4d1f5cc commit e5fee10

2 files changed

Lines changed: 505 additions & 580 deletions

File tree

Numerics/Mathematics/Optimization/Dynamic/Dijkstra.cs

Lines changed: 0 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -66,79 +66,6 @@ public struct Edge(int fromNodeIndex, int toNodeIndex, float edgeWeight, int edg
6666
public int Index = edgeIndex;
6767
}
6868

69-
//public class Networks
70-
//{
71-
// private readonly List<Edge>[] _outgoingEdges;
72-
// private readonly List<Edge>[] _incomingEdges;
73-
// private readonly int _nodeCount;
74-
// private readonly int[] _destinationIndices;
75-
// //private readonly RoadSegment[] _segments;
76-
// private readonly Edge[] _edges;
77-
78-
// //public RoadSegment[] Segments { get => _segments; }
79-
// public int[] DestinationIndices { get => _destinationIndices; }
80-
// public List<Edge>[] IncomingEdges { get => _incomingEdges; }
81-
// public List<Edge>[] OutgoingEdges { get => _outgoingEdges; }
82-
83-
// public static void ResultsToCSV(float[,] result, string outputFilePath)
84-
// {
85-
// System.IO.StreamWriter sw = new System.IO.StreamWriter(outputFilePath);
86-
// //Headers
87-
// sw.WriteLine($"From_Node, To_Node, Edge, Weight_To_Destination");
88-
// //Data
89-
// for (int i = 0; i < result.GetLength(0); i++) { sw.WriteLine($"{i}, {result[i, 0]}, {result[i, 1]}, {result[i, 2]}"); }
90-
// sw.Close(); sw.Dispose();
91-
// }
92-
93-
// public static int[] PathEdges(float[,] result, int startNodeIndex)
94-
// {
95-
// List<int> edgeList = new List<int>();
96-
// int nodeIndex = startNodeIndex;
97-
// // generate the shortest path list from the results table
98-
// while (result[nodeIndex, 2] != 0)
99-
// {
100-
// edgeList.Add((int)result[nodeIndex, 1]);
101-
// nodeIndex = (int)result[nodeIndex, 0];
102-
// }
103-
// return edgeList.ToArray();
104-
// }
105-
106-
// //public int[] PathRecords(float[,] result, int startNodeIndex)
107-
// //{
108-
// // List<int> featureList = new List<int>();
109-
// // int nodeIndex = startNodeIndex;
110-
// // // generate the shortest path list from the results table
111-
// // while (result[nodeIndex, 2] != 0)
112-
// // {
113-
// // featureList.Add(_segments[(int)result[nodeIndex, 1]].RecordIndex);
114-
// // nodeIndex = (int)result[nodeIndex, 0];
115-
// // }
116-
// // return featureList.ToArray();
117-
// //}
118-
119-
// //public int[] PathRecords(float[,] result, int startRecordIndex)
120-
// //{
121-
// // List<int> featureList = new List<int>();
122-
// // for (int i = 0; i < result.GetLength(0); i++)
123-
// // {
124-
// // if (_segments[(int)result[i, 1]].RecordIndex == startRecordIndex)
125-
// // {
126-
// // int nodeIndex = i;
127-
// // // generate the shortest path list from the results table
128-
// // while (result[nodeIndex, 2] != 0)
129-
// // {
130-
// // featureList.Add(_segments[(int)result[nodeIndex, 1]].RecordIndex);
131-
// // nodeIndex = (int)result[nodeIndex, 0];
132-
// // }
133-
// // break;
134-
// // }
135-
// // }
136-
137-
// // return featureList.ToArray();
138-
// //}
139-
//}
140-
141-
14269
/// <summary>
14370
/// Dijkstra dynamic programming implementation for shortest path optimization.
14471
/// </summary>

0 commit comments

Comments
 (0)