18 views
Skip to first unread message

minal patil

unread,
May 26, 2024, 1:45:27 PMMay 26
to ns-3-...@googlegroups.com
Plz help for k means clustering and particle swarm optimization clustering in manet for Improving  QOS parameters..

Tommaso Pecorella

unread,
May 26, 2024, 5:25:28 PMMay 26
to ns-3-users
This looks like a thesis work or a (quite complex) assignment.

I'm deeply sorry, but we can't really help a lot on this because:
  1. We can't help on assignment or thesis works (academic integrity)
  2. Even if we could (and we don't), you don't mention the protocols you're trying to optimize.
My best suggestion is to focus first on the protocol you want to improve. Then focus on how to improve it, what kind of data you have, where the calculation might be performed, and so on. On this point remember that nodes can only access locally measured data or data that are transmitted by a neighbor.

In other terms, I'd first design the idea on a piece of paper, and only when it sounds implementable I'd move to the implementation.

Gabriel Ferreira

unread,
May 26, 2024, 7:33:40 PMMay 26
to ns-3-users
My tip: use armadillo and MLPack for k-means. No idea how you would use for your particular use case.

    // Dataset matrix
    arma::mat dataset = arma::zeros(measurements/coordinates/etc.size(), labels/entities.size());
    // todo: fill matrix with values
    // Prepare to run K-means
    arma::Row<size_t> assignments;
    arma::mat centroids;
    if (allowEmptyClusters)
    {
        mlpack::KMeans<mlpack::EuclideanDistance,
                mlpack::SampleInitialization,
                mlpack::AllowEmptyClusters,
                mlpack::NaiveKMeans,
                arma::mat>
            k;
        k.Cluster(dataset, cells.size(), assignments, centroids);
    }
    else
    {
        mlpack::KMeans<> k;
        k.Cluster(dataset, cells.size(), assignments, centroids);
    }
    // Print datasest
    std::cout << dataset << std::endl;
    // Print assigned index of cluster centroid for each label/entity
    std::cout << assignments << std::endl;
Reply all
Reply to author
Forward
Message has been deleted
0 new messages