Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @startuml
- TSPSolver <|-up- NNSolver
- Graph <-- NNSolver
- TSPSolver <|-up- Ant
- Graph <-- Ant
- TSPSolver <|-up- KOptSolver
- Graph <-- KOptSolver
- TSPSolver <|-- ACOSolver
- Graph <-- ACOSolver
- ACOSolver *-right- Ant
- ACOSolver o-- KOptSolver
- abstract class TSPSolver {
- # vector<int> _solution :
- # int _len
- # int _n_cities
- + {abstract} void print()
- + vector<int> solution()
- + int len()
- + bool operator < (TSPSolver& sol)
- }
- class Graph {
- - int _N
- - vector<vector<int>> _adjMat
- + Graph()
- + Graph(string filePath)
- + int n()
- + vector<int>& operator[] (int i)
- }
- class NNSolver {
- + void solve(Graph& g)
- + void print()
- }
- class Ant {
- - next(vector<int>& visited, vector<int>& choices,
- vector<double>& weights)
- + Ant()
- + void solve(Graph& g, int s, vector<int>& visited,
- vector<int>& choices, vector<vector<double>>& weights)
- + void print()
- }
- class ACOSolver {
- - string _type, _local_search_tours
- - double _alpha, _beta, _rho, _tau0,
- _tau_min, _tau_max, _a
- - int _n_ants, _max_iter,
- _n_jobs, _w, _k
- - vector<vector<double>> _tau,
- _eta_beta, _weights
- - vector<int> _vertices,
- _choices, _visited
- - vector<Ant> _ants
- - void elitist_ant_system(Graph& g)
- - rank_based_ant_system(Graph& g)
- - void max_min_ant_system(Graph& g)
- + ACOSolver(string type,
- map<string, any> params)
- + void solve(Graph& g)
- + void print()
- }
- class KOptSolver {
- - string _type
- - void two_opt(Graph& g)
- - void two_half_opt(Graph& g)
- - void three_opt(Graph& g)
- + KOptSolver()
- + void solve(Graph& g, string type,
- vector<int> init_sol, int init_len)
- + void print()
- }
- @enduml
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement