Graph Search Algorithm (Visual Web Developer Express)

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • gihope
    New Member
    • May 2007
    • 12

    #1

    Graph Search Algorithm (Visual Web Developer Express)

    Hi,

    I wonder if someone could help me. I'm trying to develop a search algorithm as I need an engine that can determine the shortest route between two locations based on the number of stops.

    I have found an article called An Extensive Examination of Data Structures Using C# 2.0 (http://msdn2.microsoft .com/en-us/library/ms379574(VS.80) .aspx) which is a very good article and it supplied four classes which I can in theory use:
    Node;
    NodeList;
    GraphNode; and
    Graph

    Unfortunately the code doesn't work (in Visual Web Developer Express). I keep getting the following errors:
    1 NodeList<T>' does not implement interface member 'System.Collect ions.Generic.IC ollection<Node< T>>.Add(Node<T> )'
    2 'NodeList<T>' does not implement interface member 'System.Collect ions.Generic.IC ollection<Node< T>>.Clear()'
    3 'NodeList<T>' does not implement interface member 'System.Collect ions.Generic.IC ollection<Node< T>>.Contains(No de<T>)'
    4 'NodeList<T>' does not implement interface member 'System.Collect ions.Generic.IC ollection<Node< T>>.CopyTo(Node <T>[], int)'
    5 'NodeList<T>' does not implement interface member 'System.Collect ions.Generic.IC ollection<Node< T>>.Remove(Node <T>)'
    6 'NodeList<T>' does not implement interface member 'System.Collect ions.Generic.IC ollection<Node< T>>.Count'
    7 'NodeList<T>' does not implement interface member 'System.Collect ions.Generic.IC ollection<Node< T>>.IsReadOnly '
    8 'NodeList<T>' does not implement interface member 'System.Collect ions.Generic.IE numerable<Node< T>>.GetEnumerat or()'
    9 'NodeList<T>' does not implement interface member 'System.Collect ions.IEnumerabl e.GetEnumerator ()'

    Can anyone advise what these are and how I can fix these? I also get the same erros when I run it in Visual Studio Express.

    Alternatively are there any prebuilt search algorithms that I can use in Visual Web Developer express.

    Thank you for taking the time to read this. Regards, Ian
  • gihope
    New Member
    • May 2007
    • 12

    #2
    I have incidentally figured out why the code isn't working. The data structures used in this article no longer exist in the class libraries quoted "System.Collect ions.Generic" such as Collection. I therefore altered the code to use ICollection which does exist in the "System.Collect ions.Generic" namespace.

    The problem with this is that ICollection is an interface and not a class that I can directly inherit from using the articles code. This could be wrong, but from what I have deduced I would need to have also implemented the methods of this interface also in order to inherit fro it??

    If anyone else comes accross this problem, I suggest using the "System.Collect ions.ObjectMode l" namespace as it has a collection base class from which you can inherit the NodeList class.

    It would have saved me considerable time if the article had reflected the current state of developments, but then I guess I wouldn't have understood it better!

    Thank you to anyone who may have spent time trying to work out what the isue was. Kind Regards, Ian

    Comment

    Working...