Code Monkey home page Code Monkey logo

dep_graph's Introduction

CERN_test dep_graph

This script is a method to implement a full dependency graph using a recursion logic. The task was to create a graph for the dependency inputs which as taken as input.

Dependencies:

  • System Windows
  • Language Python 3.6.10 or greater

sub dependencies/ modules for running the script

  - os 
  - json
  - pathlib

time and space complexity:

The nested for loop, which currently contributes to the time complexity of the scripts, has a worst-case time complexity of O(N * M). where N represents the keys in the json list and M is the size of the dictionary's values. Recursion logic is used in this particular solution, which saves time, however using a graph or dfs tree would be far more effective and take up less time because it can traverse directly across data it has already visited and does not need to recalculate the graph.

The implementation of a BFS tree would function much better in terms of space complexity than a recursive approach with the comparable goal of not overloading memory while saving the same data and instead saving the nodes as a list.

additional work to be done:

More test cases that were discovered need to be worked on as well as attempts to construct it using a dfs tree and ultimately a graph method.

basic working:

The program iterates over the dependencies in a linear loop until we locate a dependency that satisfies the requirement of also being a parent dependency to another child dependency. This is how it works in its simplest form. A recursive function is used anytime this condition is met, and separate, smaller dependence checks are triggered. This keeps running until we exhaust the list completely.

dep_graph's People

Contributors

devlokcodes avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.