1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Drupady [299]
3 years ago
9

The goal of this problem is to cover all roads with cameras. A camera placed at a station can cover all the roads connected to i

t. For example, if we place a camera at station 0, the roads (or edges) (0,3) and (0,8) are covered. Note: the edges (0,3) and (3,0) are the same. We want to find all solutions that can cover a network. For example, one solution is to place a camera at each station will cover all roads. In G2, which has 10 stations, this solution is the set {0,1,2,3,4,5,6,7,8,9} or [True, True, True, True, True, True, True True, True, True). Another solution for G2 is {2, 3, 5, 8} or [False, False, True, True, False, True, False, False, True, False, False]. Any road/edge in G2 is connected to one of these 2 or 3 or 5 or 8. Therefore, {2,3,5, 8} is one of the solutions we look for. The code below is almost complete in printing out all solutions, i.e. sets of stations that cover an entire network. What you need to do for this problem is modyfing the is_coverage function, which returns True if the solution is a coverage, and False if it is not. At this time, it's just a placeholder, which always returns True. This is obviously incorrect. You need to fix it. [42]: def is_coverage (solution, G): return True def get_stations(s): return set([i for i in range(len(s)) if s[i]==True]) def cover(G, solution, i): if i==len(solution): if is_coverage (solution, G): print(get_stations ( solution)) else: solution[i] = True cover(G, solution, i+1) solution[i] = False cover(G, solution, i+1)
Computers and Technology
1 answer:
Sergeeva-Olga [200]3 years ago
6 0

Answer:

srry dont know

Explanation:

You might be interested in
What are the advantages of using the internet as theinfrastructure for electronic commerce and electronicbusiness?
Mrac [35]

Answer and Explanation:

E-commerce and e-business is a major business of the present time using the internet. It is basically defined as the online selling of goods or making any business online. Internet is the basic requirement for the e-commerce or e-business as

  • it helps in providing the internet connectivity so that the e-business can be displayed online and users can buy goods or interact with seller regarding the business.
  • Due to internet service users get to know about the online business and thus the business attains economic growth and benefit.

6 0
3 years ago
What is the benefit of making an archive folder visible in the Outlook folder list?
Rufina [12.5K]

Answer:

a

Explanation:

5 0
2 years ago
I need help with Exercise 3.6.7: Sporting Goods Shop in CodeHS. ASAP
attashe74 [19]

Answer:

OK

Explanation:

7 0
3 years ago
I need help picture above
sammy [17]

Answer:

True

Explanation:

hoped I helped Im Eve btw Have a great day and consider marking this brainliest if you do thank you in advanced!

6 0
3 years ago
Read 2 more answers
Return true if the given non-negative number is a multiple of 3 or 5, but not both. Use the % "mod" operator.
Pani-rosa [81]

the following C++ function will return true if the given non - negative number is multiple of 5 or 3 else it will return false.

bool function( int x ){

// variable to check if it is multiple of both or not

int number =0;

if(3%x == 0){

number++;

}

if(5%x == 0){

number++;

}

// Now returning by deciding

if( number <=1)

return true;

else

return false

}

4 0
3 years ago
Other questions:
  • This assignment is to read from an input file and process the data for a group of people. Your program calculates the interest a
    5·1 answer
  • Describe how using active listening at work can help you be a better employee.
    15·1 answer
  • Networks that are designed to connect similar computers that share data and software with each other are called:
    10·1 answer
  • How do you double space on microsoft word?
    5·1 answer
  • Write a program that prints the numbers 1 to 4 on the sameline with each pair of adjacent numbers separated by a single space(1
    5·1 answer
  • How to measure potential energy of a ball?
    14·1 answer
  • In Microsoft Word you can access the _______ command from the "Mini toolbar". A. insert citation B. save as C. underline D. word
    11·2 answers
  • Hey im b---o---r---e---d dont report cuz if u do ur l a m e :)
    14·1 answer
  • Can you anyone please help me​
    13·1 answer
  • What are the main types of database end users,? Discuss the main activi-ties of each
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!