This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Given the adjacency list of a graph, computes a spanning tree at random uniformly. Uses Andrei Broder's algorithm based on | |
| * a random walk on the graph (https://www.cs.cmu.edu/~15859n/RelatedWork/Broder-GenRanSpanningTrees.pdf). | |
| * | |
| * @method randomSpanningTree | |
| * @param {Array} The graph's adjacency list as an array. Vertices are labeled by their index in the array. E.g. the triangle graph is [[1, 2], [0, 2], [0, 1]]. | |
| * @return {Array} Returns the adjacency list of the spanning tree as an array. | |
| */ | |
| function randomSpanningTree(graph) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| license: mit | |
| height: 600 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Calculates today's sunrise and sunset hours in local time (or in the given tz) for the given latitude, longitude. | |
| * The tz parameter is mainly for the possible circumstance that your system timezone does not match the location | |
| * you are currently at. | |
| * | |
| * Computations are based on the formulas found in: | |
| * https://en.wikipedia.org/wiki/Julian_day#Converting_Julian_or_Gregorian_calendar_date_to_Julian_Day_Number | |
| * https://en.wikipedia.org/wiki/Sunrise_equation#Complete_calculation_on_Earth | |
| * | |
| * @method suntimes |