dijkstra时间复杂度
时间: 2023-08-30 17:10:02 浏览: 96
Dijkstra算法的时间复杂度取决于图的规模,具体而言,对于一个有N个顶点和M个边的图,Dijkstra算法的时间复杂度为O((N+M)logN)。这是因为在算法的实现过程中,需要使用堆优化来优化查找最小值的操作,而堆的插入和删除最小值的操作的时间复杂度是logN,而每个顶点的插入和删除最小值操作都会执行一次,所以总的时间复杂度就是O((N+M)logN)。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *3* [Dijkstra简述](https://blog.csdn.net/corqna/article/details/126259604)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"]
- *2* [Dijkstra算法](https://blog.csdn.net/weixin_46050172/article/details/106456235)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文