make-github-pseudonymous-again / js-algorithms Goto Github PK
View Code? Open in Web Editor NEW:rocket: Algorithms for JavaScript
License: GNU Affero General Public License v3.0
:rocket: Algorithms for JavaScript
License: GNU Affero General Public License v3.0
implement
see also
related
Linear time measure approximation of a set union given oracles for uniform sampling on the multiset union and membership testing on the insertion-order labeled set union.
measure: |S|
e.g. volume, cardinality, ...
set union: U_i S_i
uniform sampling on the multiset union: Sample (y, k)
from U_i { (x, i) : x in S_i }
uniformly at random.
membership testing on the union-order labeled set union: Test whether (y, k)
belongs to U_i { (x, i) : x in S_i, x not in S_j for j < i }
. Can be implemented as testing whether y
belongs to { x in S_k : x not in S_j for j < k }
in general.
implement algorithms 0.5, 0.63 and 0.75.
min_b Ab - y
b = A^+ y
where A^+ is the pseudoinverse of A
See Introduction to algorithms by TH Cormen, CE Leiserson, RL Rivest, C Stein.
Migrate minima
function.
@Article{thomassen1994every,
title={Every planar graph is 5-choosable},
author={Thomassen, Carsten},
journal={Journal of Combinatorial Theory Series B},
volume={62},
number={1},
pages={180--181},
year={1994},
publisher={Academic Press, Inc. Orlando, FL, USA}
}
Input:
A triangulation T with outer boundary cycle C,
two adjacent vertices on C named u and v
and color assignment L for T such that
L(u) = {1},
L(v) = {2},
|L(o)| >= 3 for o in C - {u, v}, and
|L(i)| >= 5 for i in T - C.
Output: A proper coloring of T.
Steps:
Color u with the color in L(u) and color v with the color in L(v).
Base case: |T| = |C| = 3, color o in C - {u,v} with one of the colors in L(o) - L(u) - L(v).
If there is a chord (s,t) of C then split C along this chord into two
smaller cycles, given two strictly smaller triangulations A and B.
Let A be the triangulation that contains (u,v).
Recursively color B with L.
This gives a color assigment to s and t of 1' and 2' respectively. Let L'(s) = 1'
and L'(t) = 2' and L'(x) = L(x) for all other vertices in B.
Recursively color B with L'.
There is no chord. Let t != v be the other vertex of C that is adjacent to u.
Let L'(t) = L(t) - L(u). L'(t) contains at least 2 colors {x,y}.
For all vertices f adjacent to t that are in T - C let L'(f) = L(f) - {x,y}.
For all other vertices x of T let L'(x) = L(x).
Recursively color T - {t} with L'.
Let s != u (could be v) be the other adjacent vertex of t on C and x be its
assigned color without loss of generality. Extend the coloring of T - {t} to a coloring of T
by coloring t with y.
As seen on Wikipedia.
See "A Separator Theorem for Planar Graphs" by Lipton and Tarjan.
add the update, delete, decreasekey and increasekey operations
// o A r = W + µ a, µ in R
// |
// | b X = W + µ a, for some µ
// | __
// a | b = AX = A - X
// r - - - - o - - - o W
// X a . b = 0
related
create documentation repository for heap interfaces
see
start with
See Small-dimensional linear programming and convex hulls made easy by Raimund Seidel.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.