将图转换为树的程序(数据结构) [英] program to convert a graph to tree (data structure)

查看:673
本文介绍了将图转换为树的程序(数据结构)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨 请帮帮我
我有一个问题,我无法编写读取读图并给我(输出)表示该图的树的程序.

解决方案

图形.那么您可能必须削减某些图形的边缘.因此,在转换树后,您可能无法返回到图形.要转换树,可以使用BFS或DFS或最小生成树或Kruskal或素数.您可以看到一些链接,也可以在google中搜索它们.

点击


hi please helpe me
I have aproblem I can''t write a program that read agraph and give me (output) the tree that represent this graph

解决方案

If you convert a tree from a graph. then you may have to cut some of the edge of the graph. So, after converting tree, you may not back to the graph. For converting the tree, you can use BFS or DFS or minimum spaning tree or Kruskal or primes. Some links that you can see or you can search it in google.

Click


这篇关于将图转换为树的程序(数据结构)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆