Given a shortest-path problem and data storage requirements, design and implement a solution in C++ or C#.