Python Programming
This function takes two inputs: one a graph, and the other a coloring of the vertices, and determines whether or not the coloring is a proper vertex-coloring of the given graph
INSTRUCTIONS TO CANDIDATES
ANSWER ALL QUESTIONS
You will create two Python functions:
- is proper: This function takes two inputs: one a graph, and the other a coloring of the vertices, and determines whether or not the coloring is a proper vertex-coloring of the given graph.
Examples:
is_proper({“A” : [“B”, “C”], “B” : [“A”, “C”], “C” : [“A”, “B”]}, {“A” : 1, “B” : 2, “C” : 3}) should return True
is_proper({“A” : [“B”, “C”], “B” : [“A”, “C”], “C” : [“A”, “B”]}, {“A” : 1, “B” : 1, “C” : 3}) should return False
- greedy: This function takes two inputs: one a graph, and the other an ordering of the vertices as a list, and returns the proper vertex-coloring produced by the greedy algorithm over the ordering in the list
Examples:
greedy({“A” : [“B”,“C”],“B” : [“A”],“C” : [“A”]},[“A”,“B”,“C”]) should return {“A” : 1,“B” : 2,“C” : 2}
greedy({“A” : [“B”],“B” : [“A”,“C”],“C” : [“B”,“D”],“D” : [“C”]},[“A”,“D”,“B”,“C”]) should return {“A” : 1,“B” : 2,“C” : 3,“D” : 1}.
Related Questions
. The fundamental operations of create, read, update, and delete (CRUD) in either Python or Java
CS 340 Milestone One Guidelines and Rubric
Overview: For this assignment, you will implement the fundamental operations of create, read, update,
. Develop a program to emulate a purchase transaction at a retail store. This program will have two classes, a LineItem class and a Transaction class
Retail Transaction Programming Project
Project Requirements:
Develop a program to emulate a purchase transaction at a retail store. This
. The following program contains five errors. Identify the errors and fix them
7COM1028
Secure Systems Programming
Referral Coursework: Secure
. Accepts the following from a user: Item Name Item Quantity Item Price Allows the user to create a file to store the sales receipt contents
Create a GUI program that:Accepts the following from a user:Item NameItem QuantityItem PriceAllows the user to create a file to store the sales receip
. The final project will encompass developing a web service using a software stack and implementing an industry-standard interface. Regardless of whether you choose to pursue application development goals as a pure developer or as a software engineer
CS 340 Final Project Guidelines and Rubric
Overview The final project will encompass developing a web service using a software stack and impleme