⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 shortestpath.h

📁 演示了最短路径的算法逻辑
💻 H
字号:
// ShortestPath.h: interface for the ShortestPath class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_SHORTESTPATH_H__3A0B3B6C_CE67_41A5_8586_56BB5093FFC4__INCLUDED_)
#define AFX_SHORTESTPATH_H__3A0B3B6C_CE67_41A5_8586_56BB5093FFC4__INCLUDED_

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

/*我的预定义*/
#include <string>
#include <iostream>
#include <fstream>
#include <memory>
using namespace std;
#define N 8
#define ARCN 15
#define MAX 10000
/*预定义结束*/

struct PATH
{
	char vex[N];
	int totalweight;

	PATH()
	{
		vex[0] = '\0';
		totalweight = MAX;
	}
};
struct VPosNode
{
	int x,y;
	char data;
};

struct InFo
{
	int x,y,weight;
};

class ShortestPath  
{
	int vexnum , arcnum;
	char vexs[N];	
	PATH path[N][N];
	InFo info[ARCN];
public:
	int arcs[N][N];
	ShortestPath();
	virtual ~ShortestPath();
	void floyd();
	int get_shortpath(char from,char end,string& sshort);
	//bool find_f_e(char from,char end);
};

#endif // !defined(AFX_SHORTESTPATH_H__3A0B3B6C_CE67_41A5_8586_56BB5093FFC4__INCLUDED_)

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -