Code Monkey home page Code Monkey logo

cop-robbers-gym's Introduction

Cop-Robbers-Gym

An openai gym that allows agent to catch bad guys and bad guys to escape from the long arm of the law.

What is provided in this gym?

Controllers:

Basic controllers are useful when one only wants to train one of the sides of this problem.

A naive controller for both the robber and the cops is provided.

Notice that even though its decision rules are fairly simple, it still offers non-terrible performance. Here are a few examples on the Petersen graph (which is of cop number 3):

With one cop:

gif of robber vs one cop

With two cops:

gif of robber vs two cops

With three cops (the robber instantly loses):

gif of robber vs three cops

The DAM/DAM1 (Dynamic Abstract Minimax) controller

As explored in this paper https://era.library.ualberta.ca/items/204f907a-0f02-4ee5-a42a-0c0baa364543 .

The paper does say that DATrailMax and TrailMax offer the best "suboptimality" of the included algorithms. table of comparison between pursuit algorithms However, notice that the computation time column indicates that both of those algorithms may require more than an hour of computation. This is completely inadequate for our setting.

The next-best thing is improved Cover, but its computation time is even worse.

Hence, DAM and DAM1 were chosen for this project, as they offer only 7 to 9 percent worse suboptimality while being able to parse maps in around two minutes.

DAM was first defined in https://www.aaai.org/Papers/Workshops/2006/WS-06-11/WS06-11-012.pdf . DAM1 is a simple modification of DAM where the lookahead is fixed to 1.

DAM uses the graph abstraction technique described in http://citeseerx.ist.psu.edu/viewdoc/download;jsessionid=E329D415068066663D34B192EAB274D7?doi=10.1.1.122.4060&rep=rep1&type=pdf .

Related work

Cops&robbers has been extensively studied in graph theory. However, we are still very far from a feasible algorithm, that could inform us on the "cop-win-ness" of any graph.

https://www.researchgate.net/publication/317309149_Linguistic_Geometry_Approach_for_Solving_the_Cops_and_Robber_Problem_in_Grid_Environments

https://www.google.com/url?sa=t&source=web&rct=j&url=http://webdocs.cs.ualberta.ca/~nathanst/papers/TrailMax.pdf&ved=2ahUKEwi_3c3F_vHrAhVxk-AKHVhlCHsQFjAEegQIBBAB&usg=AOvVaw0MEzu6bxMoV1wrA0PC2zC3&cshid=1600407784378

Simultaneous case: https://era.library.ualberta.ca/items/204f907a-0f02-4ee5-a42a-0c0baa364543

Notes

For finding cliques: define "coarseness" from 1/1 1/2 1/3 etc. Take coarseness times NB nodes. For each level of abstraction, repeatedly find all triangles, collapse them until we're at coarseness, and then remove leaves.

https://www.aaai.org/Papers/Workshops/2006/WS-06-11/WS06-11-012.pdf is real time, and agents cant move while they think. Doesnt really matter here, as our env if just more similar to https://era.library.ualberta.ca/items/204f907a-0f02-4ee5-a42a-0c0baa364543

cop-robbers-gym's People

Contributors

velythyl avatar

Watchers

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