# Algorithm-Design-And-Analysis
**Repository Path**: lfzds/adaa
## Basic Information
- **Project Name**: Algorithm-Design-And-Analysis
- **Description**: Course Design of Algorithm Design and Analysis at Tianjin University
- **Primary Language**: Python
- **License**: Apache-2.0
- **Default Branch**: master
- **Homepage**: None
- **GVP Project**: No
## Statistics
- **Stars**: 0
- **Forks**: 0
- **Created**: 2024-06-15
- **Last Updated**: 2024-06-15
## Categories & Tags
**Categories**: Uncategorized
**Tags**: 算法设计与分析, Python
## README
# Code File Description
| File Name | Function | Input | Output |
| --------------------------- | ------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Greedy-01_Knapsack.py | Solution to the 0-1 knapsack
problem based on Greedy
algorithm(Profits First) | ***Parameter:***
Three dataset processed
by header files
**Type:**
List | ***File Name:***
Greedy-01_Knapsack-FSU-P01.txt
Greedy-01_Knapsack-FSU-P02.txt
Greedy-01_Knapsack-FSU-P03.txt
***Type:***
Text file
***Format:***
MAX_Profits: Maximum benefit after
calculation
Optimal Solution: The optimal packaging
sequence, where 0 represents no packaging
and 1 represents packaging |
| DP-01_Knapsack.py | Solution to the 0-1 knapsack
problem based on Dynamic
Programming (DP) algorithm | ***Parameter:***
Three dataset processed
by header files
***Type:***
List | ***File Name:***
DP-01_Knapsack-FSU-P01.txt
DP-01_Knapsack-FSU-P02.txt
DP-01_Knapsack-FSU-P03.txt
***Type:***
Text file
***Format:***
MAX_Profits: Maximum benefit after
calculation
Optimal Solution: The optimal packaging
sequence, where 0 represents no packaging
and 1 represents packaging |
| BackTrack-01_Knapsack.py | Solution to the 0-1 knapsack
problem based on BackTrack
algorithm | ***Parameter:***
Three dataset processed
by header files
***Type:***
List | ***File Name:***
BackTrack-01_Knapsack-FSU-P01.txt
BackTrack-01_Knapsack-FSU-P02.txt
BackTrack-01_Knapsack-FSU-P03.txt
***Type:***
Text file
***Format:***
MAX_Profits: Maximum benefit after
calculation
Optimal Solution: The optimal packaging
sequence, where 0 represents no packaging
and 1 represents packaging |
| Header_datasetProcessing.py | Header File.
Process the dataset | ***Parameter:***
Three dataset file from FSU
***Type:***
Text file | None |
# Data File Description
| File Name | Source | Type | Format | Parameters |
| ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------ | --------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- |
| 01_Knapsack-FSU-P01.txt | [KNAPSACK_01 - Data for the 01 Knapsack Problem (fsu.edu)](https://people.sc.fsu.edu/~jburkardt/datasets/knapsack_01/knapsack_01.html "DataSet") | Text File | Line 1: Capacity of knapsack
Line 2: Number of object
Line 3: Item weight sequence
Line 4: Item profits sequence
Line 5: Optimal packaging sequence | Capacity of knapsack(c)
Number of object(n)
Item weight sequence(w)
Item profits sequence(p) |
| 01_Knapsack-FSU-P02.txt | [KNAPSACK_01 - Data for the 01 Knapsack Problem (fsu.edu)](https://people.sc.fsu.edu/~jburkardt/datasets/knapsack_01/knapsack_01.html "DataSet") | Text File | Line 1: Capacity of knapsack
Line 2: Number of object
Line 3: Item weight sequence
Line 4: Item profits sequence
Line 5: Optimal packaging sequence | Capacity of knapsack(c)
Number of object(n)
Item weight sequence(w)
Item profits sequence(p) |
| 01_Knapsack-FSU-P03.txt | [KNAPSACK_01 - Data for the 01 Knapsack Problem (fsu.edu)](https://people.sc.fsu.edu/~jburkardt/datasets/knapsack_01/knapsack_01.html "DataSet") | Text File | Line 1: Capacity of knapsack
Line 2: Number of object
Line 3: Item weight sequence
Line 4: Item profits sequence
Line 5: Optimal packaging sequence | Capacity of knapsack(c)
Number of object(n)
Item weight sequence(w)
Item profits sequence(p) |
# Result File Description
| File Name | Program Name | Function Name | Parameters | Type |
| --------------------------------- | ------------------------ | ------------------------------------------ | --------------------------------------------------------------------------------------------------------- | --------- |
| Greedy-01_Knapsack-FSU-P01.txt | Greedy-01_Knapsack.py | Knapsack(c,n,w,p,v) | c = Data[0][0]
n = Data[1][0]
w = Data[2]
p = Data[3]
v= [ p[i]/w[i] ] , i=0 to n-1 | Text File |
| Greedy-01_Knapsack-FSU-P02.txt | Greedy-01_Knapsack.py | Knapsack(c,n,w,p,v) | c = Data[0][0]
n = Data[1][0]
w = Data[2]
p = Data[3]
v= [ p[i]/w[i] ] , i=0 to n-1 | Text File |
| Greedy-01_Knapsack-FSU-P03.txt | Greedy-01_Knapsack.py | Knapsack(c,n,w,p,v) | c = Data[0][0]
n = Data[1][0]
w = Data[2]
p = Data[3]
v= [ p[i]/w[i] ] , i=0 to n-1 | Text File |
| DP-01_Knapsack-FSU-P01.txt | DP-01_Knapsack.py | Knapsack(c,n,w,p)
traceback(c,n,w,dp) | c = Data[0][0]
n = Data[1][0]
w = Data[2]
p = Data[3]
dp=Knapsack(c, n, w, p) | Text File |
| DP-01_Knapsack-FSU-P02.txt | DP-01_Knapsack.py | Knapsack(c,n,w,p)
traceback(c,n,w,dp) | c = Data[0][0]
n = Data[1][0]
w = Data[2]
p = Data[3]
dp=Knapsack(c, n, w, p) | Text File |
| DP-01_Knapsack-FSU-P03.txt | DP-01_Knapsack.py | Knapsack(c,n,w,p)
traceback(c,n,w,dp) | c = Data[0][0]
n = Data[1][0]
w = Data[2]
p = Data[3]
dp=Knapsack(c, n, w, p) | Text File |
| BackTrack-01_Knapsack-FSU-P01.txt | BackTrack-01_Knapsack.py | BackTrack(l) | l=0 | Text File |
| BackTrack-01_Knapsack-FSU-P02.txt | BackTrack-01_Knapsack.py | BackTrack(l) | l=0 | Text File |
| BackTrack-01_Knapsack-FSU-P03.txt | BackTrack-01_Knapsack.py | BackTrack(l) | l=0 | Text File |