<commit_before>import Graph, {Attributes} from 'graphology-types';
import {MinimalEdgeMapper} from 'graphology-utils/getters';

type SingleSourceDijkstraResult = {[key: string]: string[]};
type BidirectionalDijstraResult = string[];
type BrandesResult = [
  Array<string>,
  {[key: string]: Array<string>},
  {[key: string]: number}
];

export function bidirectional<
  NodeAttributes extends Attributes = Attributes,
  EdgeAttributes extends Attributes = Attributes
>(
  graph: Graph<NodeAttributes, EdgeAttributes>,
  source: unknown,
  target: unknown,
  getEdgeWeight?: string | MinimalEdgeMapper<EdgeAttributes>
): BidirectionalDijstraResult;

export function singleSource<
  NodeAttributes extends Attributes = Attributes,
  EdgeAttributes extends Attributes = Attributes
>(
  graph: Graph<NodeAttributes, EdgeAttributes>,
  source: unknown,
  getEdgeWeight?: string | MinimalEdgeMapper<EdgeAttributes>
): SingleSourceDijkstraResult;

export function brandes<
  NodeAttributes extends Attributes = Attributes,
  EdgeAttributes extends Attributes = Attributes
>(
  graph: Graph<NodeAttributes, EdgeAttributes>,
  source: unknown,
  getEdgeWeight?: string | MinimalEdgeMapper<EdgeAttributes>
): BrandesResult;<commit_msg>[shortest-path] better dijkstra types<commit_after>import Graph, {Attributes} from 'graphology-types';
import {MinimalEdgeMapper} from 'graphology-utils/getters';

type SingleSourceDijkstraResult = {[key: string]: string[]};
type BidirectionalDijstraResult = string[];
type BrandesResult = [
  Array<string>,
  {[key: string]: Array<string>},
  {[key: string]: number}
];

export function bidirectional<
  NodeAttributes extends Attributes = Attributes,
  EdgeAttributes extends Attributes = Attributes
>(
  graph: Graph<NodeAttributes, EdgeAttributes>,
  source: unknown,
  target: unknown,
  getEdgeWeight?: keyof EdgeAttributes | MinimalEdgeMapper<EdgeAttributes>
): BidirectionalDijstraResult;

export function singleSource<
  NodeAttributes extends Attributes = Attributes,
  EdgeAttributes extends Attributes = Attributes
>(
  graph: Graph<NodeAttributes, EdgeAttributes>,
  source: unknown,
  getEdgeWeight?: keyof EdgeAttributes | MinimalEdgeMapper<EdgeAttributes>
): SingleSourceDijkstraResult;

export function brandes<
  NodeAttributes extends Attributes = Attributes,
  EdgeAttributes extends Attributes = Attributes
>(
  graph: Graph<NodeAttributes, EdgeAttributes>,
  source: unknown,
  getEdgeWeight?: keyof EdgeAttributes | MinimalEdgeMapper<EdgeAttributes>
): BrandesResult;
{'fraction_non_alphanumeric': 0.09499205087440382, 'fraction_numerical': 0.0, 'mean_word_length': 7.0673076923076925, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 25, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '645402', 'n_tokens_mistral': 688, 'n_tokens_neox': 677, 'n_words': 181}