A TypeScript/JavaScript library for calculating Shapley Value

Deno

import { shapley, RealNumber } from "https://deno.land/x/shapley@1.0.4/mod.ts";

Node.js

npm install shapley

Usage

const shapleyValueForP = shapley(N, v)(p)
// N = set of players
// v = value function
// p = current player

For examples, please check examples folder.

Acknowledgement

This library is mostly based on the previous work in Taxi Sharing Fare App repository.