Example #1
0
 def head(self, triangles):
     LIMIT = 180
     knapsack = Knapsack(triangles, LIMIT)
     head = knapsack.main()
     for h in head:
         triangles.remove(h)
     head = self.sortHead(head)
     return [head, triangles]
Example #2
0
    def rest(self, triangles):
        remainig = []
        while True:
            ks = Knapsack(triangles, 180)
            seq = ks.main()
            for s in seq:
                triangles.remove(s)
            remainig.append(seq)
            if triangles == []:
                break

        return remainig