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
For which of the following values of A and B will the expression A || B be true?
Blababa [14]

Answer:

A = False, B = True

Explanation:

|| is equal OR. To the expression be true, you need one of them to be true or both.

A = TRUE, B = FALSE

Returns true

A = FALSE, B = FALSE

Returns true

A = TRUE, B = TRUE

Returns true

7 0
3 years ago
Assume the integer variable num has been assigned a valid value. What is the purpose of the following code segment?
Pie

Answer:

2

Explanation:

The num%4 operation returns the remainder, so only if num is not a multiple of 4, this value will be non-zero (it will be 1, 2 or 3).

7 0
3 years ago
Can someone please explain binary addition to me? i have a test tomorrow yikes
umka2103 [35]

Answer:

its easy

Explanation:

there are are 5 main rules

in binary there are 2 number 0 and 1

0 + 0 = 0

0 + 1 = 1

1+0=1

1+1=0 carry 1

e . g

1 1 1

1 0 1 0 1 0

+ 1 1 0 0 1 0

-------------------------

1 1 1 1 1 0 0

*in bold are the ones that you need to carry.

in decimal there are 10 possible numbers 0- 9

when you do 1 + 9 it becomes 10, this can be done easily, however if you do 1 + 9 in a table like above, you will get 0 for the first column and you will carry 1 to the next column .

in binary is the same idea but using on 2 numbers 1 and 0

e.g

1

1

+ 9

----------

1 0

*in bold are the ones that you need to carry.

hope it helps and good luck in your exam.

3 0
3 years ago
What directory under / contains the log files and spools for a linux system?â?
Stells [14]
/home is the default directory
5 0
3 years ago
1. The primary purpose of the human resource department in any company is to (1 point) A.) promote policies in the best interest
antoniya [11.8K]

Answer:

A.) promote policies in the best interest of both employees and the organization

Explanation:

The primary purpose of Human Resource Department in any organization is to promote policies in the best interest of both employees and the organization. They are like the heart of the company because they also deals with the staffing, compensation, retention, training, and employment of law and policies side of the business. The human resource department apart from writing of policies and procedures for hiring staffs also have plans in place to ensure that the right people that fits the job description and experience needed for a role are hired and trained for the job.

8 0
3 years ago
Other questions:
  • Exchanging which type of data uses the least bandwidth?
    14·1 answer
  • What is an effective way to assess user requests for additional features and functions
    10·1 answer
  • a problem-solving approach that requires defining the scope of a system, dividing it into its components, and then identifying a
    8·1 answer
  • Which document contains the dod cyber regulations for cui and cti??
    12·1 answer
  • _____ are independent and not associated with the marketing efforts of any particular company or brand.​
    9·1 answer
  • What is the target audience of an ad?
    11·1 answer
  • A technician is troubleshooting a Windows computer and needs to stop the explorer.exe process. Multiple attempts to open Task Ma
    5·1 answer
  • What does a codec do? Choose all that apply.
    5·2 answers
  • Which UML relationships should be used between a subclass and a superclass? For example, suppose there is an interface or abstra
    5·1 answer
  • What is the maximum number of characters you can have in a file name​
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!