{"id":16368928,"url":"https://github.com/apsdehal/shortest-adversarial-path-architecture","last_synced_at":"2026-02-05T10:33:24.683Z","repository":{"id":153279526,"uuid":"69910014","full_name":"apsdehal/Shortest-Adversarial-Path-Architecture","owner":"apsdehal","description":"Architecture for Shortest Adversarial Path","archived":false,"fork":false,"pushed_at":"2016-11-29T03:13:15.000Z","size":50,"stargazers_count":3,"open_issues_count":1,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-15T02:15:57.100Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/apsdehal.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-10-03T20:52:57.000Z","updated_at":"2020-06-24T14:45:32.000Z","dependencies_parsed_at":null,"dependency_job_id":"dda183cc-8687-4fff-84eb-f5bbc361579e","html_url":"https://github.com/apsdehal/Shortest-Adversarial-Path-Architecture","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/apsdehal/Shortest-Adversarial-Path-Architecture","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apsdehal%2FShortest-Adversarial-Path-Architecture","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apsdehal%2FShortest-Adversarial-Path-Architecture/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apsdehal%2FShortest-Adversarial-Path-Architecture/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apsdehal%2FShortest-Adversarial-Path-Architecture/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/apsdehal","download_url":"https://codeload.github.com/apsdehal/Shortest-Adversarial-Path-Architecture/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apsdehal%2FShortest-Adversarial-Path-Architecture/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29119232,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-05T09:40:36.738Z","status":"ssl_error","status_checked_at":"2026-02-05T09:36:49.977Z","response_time":65,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-11T02:54:13.142Z","updated_at":"2026-02-05T10:33:24.661Z","avatar_url":"https://github.com/apsdehal.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Shortest Adversarial Path - Architecture\n\n[![Build Status](https://travis-ci.org/apsdehal/Shortest-Adversarial-Path-Architecture.svg?branch=master)](https://travis-ci.org/apsdehal/Shortest-Adversarial-Path-Architecture)\n\nApplication architecture created for [Heuristics Problem Solving](http://cs.nyu.edu/courses/fall16/CSCI-GA.2965-001/) course at NYU. This architecture is specifically for the problem Shortest Adversarial Path.\n\n## Problem Description\n\nA route planner P is to plan a route from some source X to destination Y through a graph whose bi-directional edges have costs. Each time P traverses an edge, P's adversary A knows where P is and can double the cost of any edge. Adversary A can affect the same edge more than once over several turns. P is informed of all changes so has a chance to change the path.\n\nNote however that if P takes the initial graph and takes the shortest path then A might be able to make the narrowest point very expensive.\n\nBoth A and P will be told the layout of the graph (which will be fixed for the entire night of the contest) and the source and destination nodes.\n\nThe format of the edges of the graph will be\nnode1, node2\n\nHere is a [typical file](advshort). All edges have an initial cost of 1.\n\nEach team will play P and A in each pairwise contest.\n\n## Running\n\nYou need node.js to run this architecture.\n\nPreferred way to install node is using [nvm](https://github.com/creationix/nvm)\n\nor\n\nTo install node.js on debian use:\n\n\u003e apt-get install node\n\nor equivalent on your distro.\n\n**Note**: I am using node version 0.12.7. If you have any issues with running or npm, please make sure you are on same version.\n\n\nAfter installing node, run `npm install` inside the project directory.\n\n## Game Specifications\n\nStart the server using `node index.js`. Server will start running on port 5000. Pass `-f` argument if you want to change the file\n\nThere would be two clients player and adversary. Player would connect first and adversary second. When both connect, server will send the graph structure to both clients.\n\nEnd of graph edges will marked by a delimiter `#`.\n\nPlayer has to send the data to server in the following format:\n\n`y`\n\nwhere y is the next position player wants to move. If `y` is not connected (via edges) to current node of the player, this move will be simply ignored and current location would be sent to the adversary.\n\nPlayer will also get the data in the following format from server regarding adversary's move:\n\n`x y cost`\n\nwhere x and y represent the edge whose cost has been doubled and cost represent the cost after doubling.\n\nAdversary has to send the data to server in following format:\n\n`x y`\n\nwhere x and y represent the edge whose cost has to be doubled. If edge doesn't exist, the move will simply be ignored and player will get the `-1 -1 -1` meaning no edge's cost has been changed (**This must be taken care of by player on his side**)\n\nAdversary will also get the location of player as:\n\n`y`\n\nwhere y is the current location of the player.\n\nWhen the clients first connect, player is expected to send first move, then the adversary. If adversary or player send anything before their subsequent turns, those moves will be ignored.\n\nGame's end is specified via a delimiter `$`. If at any point you receive it, you should close the socket connection. Winner will be decided on architecture side.\n\nYou can check the test clients in [test-clients](test-clients/) folder.\n\n**Note**: Architecture is a work in progress and will be thorougly tested and completed by the night of competition.\n\nIf you find any issues, please feel free to open them using Github issues.\n\n## Sending the code\n\nYour code should be organized in folder which should contain two bash files named as `your_team_name_player` and `your_team_name_adversary`. Put all your files in this folder and name it as `your_team_name`. These bash files should take in as first argument a port number and accordingly call your program to connect on that port number. If not passed it should take default as 5000. Give your bash files executable permissions.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapsdehal%2Fshortest-adversarial-path-architecture","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fapsdehal%2Fshortest-adversarial-path-architecture","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapsdehal%2Fshortest-adversarial-path-architecture/lists"}