GithubHelp home page GithubHelp logo

rahulfromearth / local-graph-search-ai- Goto Github PK

View Code? Open in Web Editor NEW

This project forked from gurpreetgosal/local-graph-search-ai-

0.0 0.0 0.0 110 KB

Implementation of local graph search algorithm for minimizing the total cost of ordering of vertices of a graph w.r.t all vertices.

Python 100.00%

local-graph-search-ai-'s Introduction

local-graph-search-AI-

Implementation of local graph search algorithm for minimizing the total cost of ordering of vertices of a graph w.r.t all vertices.

We are given vertices V1, …,Vn and possible parent sets for each vertex. Each parent set has an associated cost. Let O be an ordering (a permutation) of the vertices. We say that a parent set of a vertex Vi is consistent with an ordering O if all of the parents come before the vertex in the ordering. Let mc(Vi, O) be the minimum cost of the parent sets of vertex Vi that are consistent with ordering O. The task is to find an ordering O that minimizes the total cost: mc(V1, O) + … + mc(Vn, O).

This problem is NP-Complete and so presumably intractable. Thus, it makes sense to consider using local search algorithm to solve instances of the problem.

Two data files are provided and the code parses the graph data given in the files and implements local search. To work on a particular file modify the file name accordingly in .py file.

The data file for this example would look like:

5

1 4

{},153.466

{3},96.093

{4},97.913

{5},99.835

2 4

{},141.023

{3},122.446 {4},121.576

{5},123.398

3 6

{},169.482

{1},112.109

{2},150.906

{1,2},107.516

{4},51.681

{5},41.775

The first line of the file is the number of vertices. The next lines of the file consist of the variable name and the number of parent sets, followed by each parent set and its cost on a separate line.

local-graph-search-ai-'s People

Contributors

gurpreetgosal 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.