graphology-metrics
Advanced tools
Comparing version 2.0.0 to 2.1.0
@@ -0,1 +1,2 @@ | ||
export {default as disparity} from './disparity'; | ||
export {default as simmelianStrength} from './simmelian-strength'; |
@@ -0,1 +1,2 @@ | ||
exports.disparity = require('./disparity.js'); | ||
exports.simmelianStrength = require('./simmelian-strength.js'); |
{ | ||
"name": "graphology-metrics", | ||
"version": "2.0.0", | ||
"version": "2.1.0", | ||
"description": "Miscellaneous graph metrics for graphology.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -29,2 +29,3 @@ # Graphology metrics | ||
- [Disparity](#disparity) | ||
- [Simmelian strength](#simmelian-strength) | ||
@@ -287,2 +288,32 @@ | ||
### Disparity | ||
Function computing a score for each edge which is necessary to apply a "disparity filter" as described in the following paper: | ||
> Serrano, M. Ángeles, Marián Boguná, and Alessandro Vespignani. "Extracting the multiscale backbone of complex weighted networks." Proceedings of the national academy of sciences 106.16 (2009): 6483-6488. | ||
Note that this metric requires a weighted graph or will return a useless result. | ||
Beware, the results must be interpreted thusly: a lower score means a more relevant edge, as is intuited in the paper's formulae. This means you can prune edges that have a score greater than a given threshold, as a statistical test. Some other implementations might differ in that they offer the opposite intuition (i.e. greater score = more relevant edge). | ||
```js | ||
import disparity from 'graphology-metrics/edge/disparity'; | ||
// To compute strength for every edge: | ||
const disparities = disparity(graph); | ||
// To directly map the result onto edge attributes (`disparity`): | ||
disparity.assign(graph); | ||
// Using custom weights | ||
disparity.assign(graph, {getEdgeWeight: (_, attr) => attr.importance}); | ||
``` | ||
_Arguments_ | ||
- **graph** _Graph_: target graph. | ||
- **options** _?object_: options: | ||
- **edgeDisparityAttribute** _?string_ [`disparity`]: Name of the disparity attribute to assign. | ||
- **getEdgeWeight** _?string\|function_ [`weight`]: Name of the edge weight attribute or getter function. | ||
### Simmelian strength | ||
@@ -289,0 +320,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
96962
53
2331
548
0