Click here to Skip to main content
15,896,111 members
Articles / Programming Languages / C#

Dijkstra:Shortest Route Calculation - Object Oriented

Rate me:
Please Sign up or sign in to vote.
4.32/5 (24 votes)
3 Jan 2008CPOL2 min read 203.8K   14.6K   75  
Calculation of the shortest path between x points
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace RouteEngine
{
    public class Connection
    {
        Location _a, _b;
        int _weight;
        bool selected=false;

        public bool Selected
        {
            get { return selected; }
            set { selected = value; }
        }

        public Connection(Location a, Location b, int weight)
        {
            this._a = a;
            this._b = b;
            this._weight = weight;
        }
        public Location B
        {
            get { return _b; }
            set { _b = value; }
        }

        public Location A
        {
            get { return _a; }
            set { _a = value; }
        }       

        public int Weight
        {
            get { return _weight; }
            set { _weight = value; }
        }


    }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Belgium Belgium
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions