- Dependency
- Homework 1: Minimum Dominating Set
- Homework 2: Monochromatic K4
- Homework 3: 0-1 Knapsack problem
- Homework 3: Steiner Triple Systems
- Homework 3: Uniform Graph Partition
This repo contains my assignments for MATH6010 (2022 spring) at SJTU.
Follow the commands below to start.
git clone https://github.com/sszxc/MATH6010-homework.git
cd MATH6010-homework/
python -m pip install -r requirements.txt
NetworkX for the creation, manipulation, and study of the structure, dynamics, and functions of complex networks.
matplotlib for creating static, animated, and interactive visualizations.
tqdm for a smart progress meter.
Definition: A dominating set for a graph
Theorem: Let
Task: Design a greedy algorithm to find a dominating set that satisfies the theorem.
python hw1_MinDomSet\min_dom_set.py
For example, the following is a solution for a given graph, which satisfies the theorem.
Definition:
Theorem: There is a two-coloring of
Task: Design an algorithm based on derandomization to find a method of coloring the edges that satisfies the theorem.
python hw2_MonochromaticK4\monochromatic_k4.py
The algorithm is specially optimized to take only 23 seconds for a problem of 100 vertices.
For example, the following is a two-coloring solution for
Given weights and values of n items, put these items in a knapsack of capacity W to get the maximum total value in the knapsack.
Task: Design an algorithm based on simulated annealing to solve the 0-1 knapsack problem.
python hw3_knapsack\SimulatedAnnealing.py
For example, the following is the solving process for a given knapsack problem.
Definition: A Steiner triple system is a set system
Task: Design a hill-climbing algorithm to construct random STS(v).
python hw3_STS\STS_HillClimbing.py
For example, the following gif is the solving process for STS(9). Here, the STS is presented as a hypergraph: the big green circles are the points, and the small gray circles are the blocks that connect three points.
Define a complete graph on
python hw3_UniformGraphPartition\UniformGraphPartition.py