Skip to main content

Create Graph DataStructure

Project description

Author : Amit Singh Sansoya (@amit3200) Github : https://github.com/Amit3200 library : graphqt

# Import

`import graphqt`

# Introduction This is test library for the python which lets you create graph using some functions. This library will allow you to create undirected graphs and also provides some of the other functionalities. This library is for the beginner programmer who wants to get started at the programming with the graphs and want to visualize it easily. It is highly recommended to learn the actual code so that one can implement them without using this library at the interviews, and competition. This library was designed for the programmers who are studying graph currently. This will allow them to have the idea and brute force solution to them which they can further optimize. This libary also allow’s you to do following things

  • Create Graph [Undirected]

  • Detect Cycle [Undirected]

  • Check Path [Undirected]

  • Disconnected Components [Undirected]

# Create Graph

### 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)

# Detect Cycle

### 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)

# Check Path

### 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)

# Disconnected Components

### 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

# Note

##### Remember

This library resembles undirected graph Also Get the logic behind function that is very important

# Do Support Author : ### Amit Singh Sansoya (@amit3200) ### Github : https://github.com/Amit3200

## Keep Coding and Smiling

Project details


Release history Release notifications | RSS feed

This version

0.2

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

graphqt-0.2.tar.gz (3.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

graphqt-0.2-py3-none-any.whl (8.1 kB view details)

Uploaded Python 3

File details

Details for the file graphqt-0.2.tar.gz.

File metadata

  • Download URL: graphqt-0.2.tar.gz
  • Upload date:
  • Size: 3.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.33.0 CPython/3.6.0

File hashes

Hashes for graphqt-0.2.tar.gz
Algorithm Hash digest
SHA256 d880c857afaf52d8753b0371df21f62bb0d725e26999ac92f6f4f45334a2bb0a
MD5 34ec60c04c59277e63daadf9969c01a6
BLAKE2b-256 08bf64b28107eaa9755f490f359c3ccdaa3f95432a51bb824d0a04ba6363e271

See more details on using hashes here.

File details

Details for the file graphqt-0.2-py3-none-any.whl.

File metadata

  • Download URL: graphqt-0.2-py3-none-any.whl
  • Upload date:
  • Size: 8.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.33.0 CPython/3.6.0

File hashes

Hashes for graphqt-0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 60476f8bfe2c48dd08e92be945de31daf1bf713de3933731fc0baa7cbe014ba2
MD5 1857a68d5269e52e0119e598613188b0
BLAKE2b-256 88a68b307233f3f788a718db539327c489afd133a69de49cdf34456690bcbf58

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page