Click here to Skip to main content
15,886,724 members
Articles / Programming Languages / C++

Dijkstra Algorithm

Rate me:
Please Sign up or sign in to vote.
4.43/5 (40 votes)
23 Dec 20033 min read 368.3K   22.3K   102  
Shortest path (Dijkstra's Algorithm)
// AlgorithmsView.h : interface of the CAlgorithmsView class
//
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INCLUDES()
#include "dijkstra.h"
//}}AFX_INCLUDES

#if !defined(AFX_ALGORITHMSVIEW_H__90F8503B_B5A6_4EAA_B57A_3A22A2DAB661__INCLUDED_)
#define AFX_ALGORITHMSVIEW_H__90F8503B_B5A6_4EAA_B57A_3A22A2DAB661__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000


class CAlgorithmsView : public CFormView
{
protected: // create from serialization only
	CAlgorithmsView();
	DECLARE_DYNCREATE(CAlgorithmsView)

public:
	//{{AFX_DATA(CAlgorithmsView)
	enum { IDD = IDD_ALGORITHMS_FORM };
	CDijkstra	m_Dijkstra;
	//}}AFX_DATA

// Attributes
public:
	CAlgorithmsDoc* GetDocument();

// Operations
public:

// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CAlgorithmsView)
	public:
	virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
	protected:
	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
	virtual void OnInitialUpdate(); // called first time after construct
	virtual BOOL OnPreparePrinting(CPrintInfo* pInfo);
	virtual void OnBeginPrinting(CDC* pDC, CPrintInfo* pInfo);
	virtual void OnEndPrinting(CDC* pDC, CPrintInfo* pInfo);
	virtual void OnPrint(CDC* pDC, CPrintInfo* pInfo);
	//}}AFX_VIRTUAL

// Implementation
public:
	virtual ~CAlgorithmsView();
#ifdef _DEBUG
	virtual void AssertValid() const;
	virtual void Dump(CDumpContext& dc) const;
#endif

protected:

// Generated message map functions
protected:
	//{{AFX_MSG(CAlgorithmsView)
	afx_msg void OnMouseDownDijkstra1(short Button, short Shift, long x, long y);
	afx_msg void OnAddNode();
	afx_msg void OnAddEdge();
	afx_msg void OnShortestPath();
	DECLARE_EVENTSINK_MAP()
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
};

#ifndef _DEBUG  // debug version in AlgorithmsView.cpp
inline CAlgorithmsDoc* CAlgorithmsView::GetDocument()
   { return (CAlgorithmsDoc*)m_pDocument; }
#endif

/////////////////////////////////////////////////////////////////////////////

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_ALGORITHMSVIEW_H__90F8503B_B5A6_4EAA_B57A_3A22A2DAB661__INCLUDED_)

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 has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
Web Developer
Romania Romania
Education Computer Engineering Faculty 1994-1999
University of Iasi ? Romania
Engineering degree: system and computers
Specialty: programmer analyst
License: (Computer Engineering Faculty) 2000
Master: (Distributed Computing) 2001 - 2002
Final Project: Remote Access. Encrypted file transfer.
Accessing any computer?s desktop through Internet or LAN.
Technologies: COM, ATL, API, SDK, MFC

Comments and Discussions