Skip to content

Commit fcf8b15

Browse files
authored
Update knapsack.py
1 parent d74e842 commit fcf8b15

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Knapsack_SubsetSum/knapsack.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
#from fpylll import *
1+
from fpylll import *
22
import random,math,operator,time
33
from operator import itemgetter
44
import numpy as np
5-
#from __future__ import division
5+
from __future__ import division
66
from numpy import matrix
77
from numpy import linalg as LA
88
from numpy import matlib
@@ -18,7 +18,7 @@ def find_random(n, d, hamming):
1818
solution = rand_bin_array(n-hamming,n)
1919
a0 = np.dot(solution, a)
2020
#return a, a0, density, sum(solution), len(solution), solution
21-
return a,0,sum(solution)
21+
return a,a0,sum(solution)
2222

2323
def fp2mat(A):
2424
L = np.zeros(shape=(A.nrows,A.ncols))

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy