In  and , we have introduced some methods to compute similar/diverse and/or weighted solutions in Answer Set Programming. Below you will find a description of these methods, as well as their implementations.
CLASP-NK is an answer set solver which extends CLASP. CLASP-NK takes three parameters as input N, K and a distance function (from a solution to the problem to real numbers) which is implemented in C++ along with an ASP program that defines a solution to a problem. Then, it computes a set of N solutions to the problem whose distance is at most/least K (n k-similar/diverse solutions). See  for technical details
You can download the source code of CLASP-NK from below (we recomend you to download the latest version):
Version 2 (with documentation and examples): download
Version 1: download
Similar to CLASP-NK, CLASP-W is an answer set solver which extends CLASP. CLASP-W takes two parameters as input W and a weight function (from a solution to real numbers) which is implemented in C++ along with the program that defines a solution to a problem. Then, it computes a solution whose weight is above/below W (w-weighted solution). See  for technical details.
You can download the source code of CLASP-W from here.
We suggest you to read this documentation before using clasp-w.