GithubHelp home page GithubHelp logo

Comments (3)

dongahn avatar dongahn commented on August 11, 2024 1

When I thought about this a bit after the coffee hour, one potential solution could be perhaps to use "longest increasing sequence". https://en.wikipedia.org/wiki/Longest_increasing_subsequence.
You sort the users based on the new shares/usages. But then, you identify the longest increasing sequence based on the previous fairshare values from the newly sorted vector and then reuse these old fairshare values.
For only those who are not in the LIS set are assigned to new fshare values in a way still to hold proper ordering with these reused fairshare values.
The LIS algorithm could be expensive and the complexity would also be high so I'm not sure if this is worthy it.

from flux-accounting.

dongahn avatar dongahn commented on August 11, 2024

A could of things from our slack:

@SteVwonder:

@dahn and @milroy: I went down a rabbit hole after the coffee time. Looks like there is a way to find the minimum number of swaps required to sort an array. https://stackoverflow.com/questions/2987605/minimum-number-of-swaps-needed-to-change-array-1-to-array-2
It involves calculating/leveraging the permutation cycle: https://mathworld.wolfram.com/PermutationCycle.html
I haven't fully grok'd it, but its something to maybe come back to later on down the road.

Cool thing is that the calculation is O(n*logn)

from flux-accounting.

dongahn avatar dongahn commented on August 11, 2024

Interesting. We should probably think through... whether this will allow us to keep the intitial faireshare values as much as possible.

from flux-accounting.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.