设一个包含n个顶点、e条弧的简单有向图采用邻接矩阵存储结构(即矩阵元素A[i][j]团等于1或0,分别表示顶点i与顶点j之间有弧或无弧),该矩阵购非零元素数目为( )。
2023-09-01
A.e
B.2e
C.n-e
D.n+e
参考答案:A
B.2e
C.n-e
D.n+e
参考答案:A
用邻接矩阵存储有向图,图中每一条弧对应矩阵一个非零元素,题目中提到一共有e条弧,所以一共e个非零元素。
miao__miao 2016-05-13
请问矩阵是对称矩阵吗,那a-b和b-a都是1,节点数是不是应该是2e
MegumiIsh 2016-05-14
是不是对称矩阵看图,如果是无向图表示两个顶点直接的关系,那邻接矩阵是对称矩阵。如果是有向图的话又不一样,每一条弧对应矩阵一个非零元素,比如从节点i到节点j有边,则Aij为一个非零元素。如果从节点j到节点i有边,则Aji为一个非零元素。题目中提到一共有e条弧,所以一共e个非零元素。
![]( //img1.runjiapp.com/duoteimg/tiku/images/pc/questionBank/main-list-title-icon.png)
![](https://img1.runjiapp.com/duoteimg/tiku/banner/bn_81.jpg)
![](https://img1.runjiapp.com/duoteimg/tiku/banner/bn_79.jpg)
![](https://img1.runjiapp.com/duoteimg/tiku/banner/bn_74.jpg)
![](https://img1.runjiapp.com/duoteimg/tiku/banner/bn_100.jpg)
![](https://img1.runjiapp.com/duoteimg/tiku/banner/bn_75.jpg)
![](https://img1.runjiapp.com/duoteimg/tiku/banner/bn_37.jpg)
![](https://img1.runjiapp.com/duoteimg/tiku/banner/bn_66.jpg)
![](https://img1.runjiapp.com/duoteimg/tiku/banner/bn_9.jpg)
![](https://img1.runjiapp.com/duoteimg/tiku/banner/bn_89.jpg)
热门标签