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

📄 graph.h

📁 我写的,画出最短路径,及最小生成树 Prim Dijistra算法+ GDI实现
💻 H
字号:
// Graph.h: interface for the CGraph class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_GRAPH_H__F524152D_AE4F_4720_9F4B_3D214CDA3117__INCLUDED_)
#define AFX_GRAPH_H__F524152D_AE4F_4720_9F4B_3D214CDA3117__INCLUDED_

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

class CGraph  
{
public:
	CGraph();
	virtual ~CGraph();
struct Point
	{
         int Index;
		 int x,y;
			struct Adj
			{
				bool Visited;
				double Weight;
				struct Point *Address;
				struct Adj *Next; 
			}*AjNow;
        struct Adj *First;
		struct Point *Next;
		 
	}*Head,*Now,*Latest,*Bridge,*SNow;
    int P[100];//
	int CloseVertex[100];
	int Max;
	void AddNew(int x,int y);
	bool SetPath(int &x1,int &y1,int &x2,int &y2);
	void ReDraw();
	bool StartToEnd(int &x1,int &y1,int &x2,int &y2);
	int StartIndex;
	int EndIndex;
	bool Orient;
	void SearchPath();
	void Prim();
private: 
	
	double Min;
	double PathValue;
	double D[100];
	double LowCost[100];
	bool Final[100];
    void SetAdj(int Index1,int Index2);
};

#endif // !defined(AFX_GRAPH_H__F524152D_AE4F_4720_9F4B_3D214CDA3117__INCLUDED_)

⌨️ 快捷键说明

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