chinese_postman 0.1.1 copy "chinese_postman: ^0.1.1" to clipboard
chinese_postman: ^0.1.1 copied to clipboard

outdated

Dart package to solve the Chinese Postman Problem for undirected, weighted graphs

example/chinese_postman_example.dart

import 'package:chinese_postman/chinese_postman.dart';

void main() {

  Postman p = Postman();

  Map<int, Map<int, double>> graph = {
    1: {2: 6, 5: 10, 4: 10, 3: 10},
    2: {5: 7, 7: 16},
    3: {4: 10, 6: 7},
    4: {5: 1, 6: 5},
    5: {7: 7},
    6: {7: 13}
  };

  List<int> tour = p.postmanTour(graph, startingVertex: 2);
  print(tour);
  print('total cost: ${p.cost()}');

}
0
likes
0
points
57
downloads

Publisher

unverified uploader

Weekly Downloads

Dart package to solve the Chinese Postman Problem for undirected, weighted graphs

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

dijkstra

More

Packages that depend on chinese_postman