Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

in python please A 82%. 12:50 PM 1. Cop and Robber Overview: We describe the 2-p

ID: 3699866 • Letter: I

Question

in python please

A 82%. 12:50 PM 1. Cop and Robber Overview: We describe the 2-player game called "Cop and Robber". There are two players: one is the cop and the other is the robber. The game can be played on any graph.. a set of vertices, and edges that connect them to make a network). The galne is put into initial position by first allowing the cop to place herself at any vertex, followed by allowing the robber to place himself at any vertex. After the players have both placed themselves, the players alternate taking turns, with the cop starting. On a turn, a player can move from a vertex to an adjacent vertex, or remain at the same vertex. The cop wins if she ever occupies the same vertex as the robber. The robber wins if the cop gives up, or the number of moves more than some user inputed number example Requirements: You must 1) create a class named CopRobGame, which will be described below, 2) create other classes as needed, which will all be known by the top level class CopRobGame, 3) write a simple console game (no graphics!) for the game using the class CopRobGame and a few simple calls to it The class CopRobGame, must have at least te following methods (it may have more methods e 25 moves) (a) The initializer takes one positive integer argument, which is the limit on the number of moves before the game is over (and the robber wins) (b) createVertex: Takes a single string input as an argument and adds this vertesx to the graph, attaching it to no other vertices. (c) createEdge: Takes 2 strings as input, and creates an edge between the 2 vertices with those string names. If the 2 strings are the same, or one of the strings is not the name of a vertex, then no edge is created. If the edge already exists, nothing new is created. Returns the boolean True if a new edge was created, and False otherwise. (d) placePlayer: Takes 2 strings as iput The first string should be either "C or R", to indicate Cop or Robber, respectively. The second string should be the name of a vertex. The indicated player is placed at that vertex (e) movePlayer: Takes 2 string inputs; the first should be eithe C or "R", to indicate Cop or Robber, respectively. The second string should be the name of the vertex to move the player to. The method should return True if the player was successfully moved there, and False if there was some problem (f) winCheck: Takes no inputs and returns one of 3 strings: "C" if the cop and robber occupy the same vertex "R" if the number of moves is past the limit; and "X" if neither player has won yet (g) display: This creates a text output of the current state of the graph and the positions of the players (if they are placed), in a the following series of lines, each separated by a single newline character i. The string Cop:folwd by the name of the vertex where the cop is; if the Cop has not been placed, then the string "Cop not placed. appears. Then there are some spaces, and an analogous printout for the Robbe "Robber followed by the name of the vertex where the robber is; if the Robber has not been placed, then the string "Robber not p ii. The string "Verticsfollowed by a comma separated listing of the vertices. ii. The string "Edges: followed by a comma separated listing of the edges, where each edge is of the form "vertex name], [vertex name])

Explanation / Answer

Minimum Requirements

1. Produce a simulation of the Cops and Robbers Game, restricted to particular types of graphs.

2. Implement user Interaction with the Cops and Robbers Game simulation.

3. Produce analysis of the Cops and Robbers Game with fast robbers.

Objectives

The objectives for the project are to produce working simulation of the Cops and Robbers Game, and to provide some theoretical analysis of the Cops and Robbers Game, with the hope that some meaningful contribution can be made to the field of Theoretical Computer Science.

Deliverables

A simulation of the Cops and Robbers Game providing different modes of play for different graph class restrictions. The simulation will provide a practical demonstration of Cop, Robber, and placement strategles formulated as part of the project. The simulation will be implemented as a program displaying simple animations for representing movement of Cops and Robbers through a graph. An event-driven control system will be provide user Interaction.

A Short Introduction To Graph Theory Not all readers of this project report will be completely familiar with Graph Theory, and the terminology invloved. In order to allelate this, it has been decided to provide a simple introduction explaning the definition of graphs and some of the common terminology used. A graph G is defined by a tuple G = (V, E), where V is the set of vertices (also refered to as nodes), and E is the set of edges in the graph. An edge is a pair of vertices (u, v) such that u? V? v? V. A graph can be thoughout of as an object where dots (vertices) are joined by lines. All graphs dealt with in this project will be undirected graphs, or in other words, graphs where the edges lack direction. Because of this, for edges, (v, u) = (u, v). From this point forward, V(G) will denote the vertex set of a particular graph. E(G) will denote the edge set of a graph. For ease of notation, u ? G will sometimes be used to mean u? V(G). A vertex u is adjacent to a vertex v if there exists (u, v) ? E(G). The adjacency set of a vertex v is the set of all vertices v is connected to. The adjacency set will be refered to with the notation N[v], which includes the vertex v itself. The degree of a vertex d(v) can then said to be d(v) = |N[v]| ? 1,

or

In other words, the degree is the number of vertices v is adjacent to. The size of a graph is the number of edges in a graph, or |E(G)|. The order of a graph is the number of vertices are joined by more than one edge, unless otherwise stated. For ease of notations, a set S minus an element e will sometimes be expressed as Se. A graph produced from removing a vetex and all connected edges will sometimes be expressed as G , for some vertex v. If a bijection f : V(G) ? V(H) exists between two graphs G and H where ? u ? V(G), ? v? V(G) (u, v) ? E(G) ? (f(u)m f(v) ? E(H)), then the two graphs are said to be isomorphic. Isomorphism entails that one graph can be redrawn to appear exactly like the other graph.