agraph.h

来自「贪婪算法合集,包括二分覆盖,单源最短路径,拓扑排序,机器调度问题」· C头文件 代码 · 共 17 行

H
17
字号
// 图的邻接矩阵,也就是固定没有边就=0, 然后权值也是为1

#ifndef AdjacencyGraph_
#define AdjacencyGraph_

#include "awgraph.h"

class AdjacencyGraph : public AdjacencyWGraph<int>
{
public:
	AdjacencyGraph(int Vertices = 10) : AdjacencyWGraph<int>(Vertices, 0) {}
    AdjacencyGraph& Add(int i, int j) {AdjacencyWGraph<int>::Add(i,j,1); return *this;}
	AdjacencyGraph& Delete(int i, int j){AdjacencyWGraph<int>::Delete(i,j);return *this;}
};

#endif

⌨️ 快捷键说明

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