defneighbors(self,node):"""returns a list of the arcs for the neighbors of `node`"""self.neighboursList=[]ifnode[1]==1:# torch is on left...










def


neighbors(self,

node):






"""returns a list of the arcs for the neighbors of `node`"""








self.neighboursList

=


[]






if


node[1]

==


1:

# torch is on left side








if


len(node[0])

==


4:






self.neighboursCombinationsList

=


list(combinations(node[0],

2))












elif


len(node[0])

==


3:






self.neighboursCombinationsList

=


list(combinations(self.start_node()[0],

1))










for


combination

in


self.neighboursCombinationsList:






self.neighboursList.append([combination,

0])












else:

# torch is on right side








if


len(node[0])

==


2:






self.neighboursCombinationsList

=


list(combinations(self.start_node()[0],

3))










elif


len(node[0])

==


1:






self.neighboursCombinationsList

=


list(combinations(self.start_node()[0],

2))










for


combination

in


self.neighboursCombinationsList:






self.neighboursList.append([combination,

1])









Feb 02, 2023
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here