创建图形数据结构

graphqt的Python项目详细描述


作者:amit singh sansoya(@amit3200) Github:https://github.com/Amit3200 库:graphqt

#导入

`import graphqt`

#介绍 这是python的测试库,允许您使用一些函数创建图形这个库将允许您创建无向图,并提供一些其他功能。这个库是为初学者程序员谁想开始与图形编程,并希望它容易可视化。强烈建议您学习实际的代码,以便在面试和竞争中不使用此库就可以实现它们这个库是为目前正在学习图形的程序员设计的这将使他们有想法和暴力解决方案,他们可以进一步优化。这本书还允许你做以下事情

  • 创建图形[无向]
  • 探测周期[无向]
  • 检查路径[无方向]
  • 断开的组件[无方向]

#创建图形

### Description:

This function allow you to add the edge between two nodes. The use of this function is very simple. One only needs to pass the dictionary so called graph,node u and node v where edge will exist between u and v. Moreover the edge v and u will be automatically created as this is undirected graph.

Function Use : insertuv(dictionary_name,node1,node2) Example : graphqt.insert_uv(d,1,2) Return Type : None In above example d is the dictionary (so called graph)

#检测周期

### Description:

As the name suggests, this function will allow you to detect if there is a cycle in graph Return type is Boolean [True or False] where True tells that graph has cycle and False depicts there is no cycle. This will detect as per the undirected graph.

Function use : detect_cycle(dictionary_name) Example : graphqt.detect_cycle(d) Return Type : Boolean In above example d is the dictionary (so called graph)

#检查路径

### Description:

As the name says this function will tell you if there exists the path between two nodes. One only needs to pass dictionary_name (so called graph), the node u and node v. This function returns boolean value. True if there is path between u and v else False

Function use : check_path(dictionary_name,node1,node2) Example : graphqt.check_path(d,2,8) Return Type : Boolean In above example d is the dictionary (so called graph)

#断开的部件

### Description:

As the name says this function will detect the disconnected components and this will return a dictionary having keys as: ‘dis_count’: This will give you the values of count of disconnected components in a graph. If the value returned is 1 then there is no disconnected component. [ Makes Sense ;) ] ‘components’: Gives the list of containing nodes which are connected together

Function use : graphqt.get_disconnected_components(d) graphqt.get_disconnected_components(d)[‘dis_count’] graphqt.get_disconnected_components(d)[‘components’] Return Type : Dict

#注

记住

这个库类似于无向图 同时获得非常重要的函数后面的逻辑

#支持作者: ###阿米特·辛格·桑索亚(@amit3200) ###github:https://github.com/Amit3200

##保持编码和微笑

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java为什么只为字符数组重载println方法,而不为字符串、整数等其他数组重载?   java将快速线程返回到池中,而不是等待慢速线程   创建jar文件时java SwingWorker不工作   java如何将依赖注入RabbitListener   java如何在gradle任务中通过scp复制目录?   java在MySql数据库中创建表时,遇到NullPointerException   java HTTP Status 500 Servlet执行引发异常   在JAVA中对arraylist使用继承时出错   java PowerMockito未完成存根异常   如果没有错误/警告增加到某个极限,java是否停止在eclipse中构建项目或使用maven?   java Robolectric如何测试DateFormat。getBestDateTimePattern()   google云平台GCP数据存储Java API,构建一个空值实体   VerifyListener和FocusListener之间的java冲突   安卓是否可以在Java中的另一个方法内部强制调用一个方法?   JavaWindows7、JDK1.8、SpringBoot应用程序JAR在方法安全性方面占用了大量时间。getProviders()返回   Bean提供程序的java错误消息   java Slick动画每帧必须有一个持续时间   java无法在Trie中设置isLeaf标志   java为什么JVM不能创建包含main方法的类的对象,以便从该类访问main方法,如果它具有该类的名称?   java Apache Camel+CXF端点身份验证