Skip to content

Genetic algorithm implementation for maximum weighted independent set problem

License

Notifications You must be signed in to change notification settings

erenulas/genetic-algorithm-MWISP

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Genetic Algorithm for MWISP

This is the implementation of genetic algorithm for maximum weighted independent set problem. Each graph should be given as a text file. An example graph can be found in test.txt file. Format of each graph file:

  • First line consists of an integer n which represents the number of nodes.
  • Second line contains an integer m which represents the number of edges in graph.
  • Next n lines' format is 'node weight', and node indicates the node itself and weight indicates its weight.
  • Next m lines' format is 'node1 node2' which represents an edge from node1 to node2.

For each run some input parameters are required for the calculation:

  • Name of the Graph File
  • Generation Limit
  • Population Size
  • Crossover Probability
  • Mutation Probability

How to Use It?

  • Clone the repo.
  • Run 'python3 genetic.py'.
  • Be sure that graph file is at the same location as 'genetic.py'.

About

Genetic algorithm implementation for maximum weighted independent set problem

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages