Because the brain forgets,
🤖in-v-bat-ai
🧠Recall
Mission
Traveling Salesman Problem 6 Cities
Never Forget Again

🌍 Trusted by 243,234 learners in 149 countries <\div>

A synapse is the tiny gap where one neuron passes information to the next.

Your brain stores knowledge in neuron connections called synapses. When those connections or links fade, you forget.
THE SOLUTION: IN-V-BAT- AI


Try It Now. Only $1



Traveling Salesman Problem 6 Cities
Never Forget Again

Find the shortest distance route starting from City A and visiting all the remaining 5 cities just once and then return back to original starting point City A. There are 15 input distances and 120 possible combination to get the shortest route distance.

5
23
19
25
33
14
7
12
15
44
5
8
55
7
15


H

The reverse direction is also correct: Solution 109, AFEDCBA

🔗 Solve it once. Never forget.
From hand calculation to trusted automation—IN-V-BAT-AI makes remembering effortless.


See real time calculation:
Change distance b to e from 33 to 3. What is the shortest route? Answer = 42, solution 13, ABECDFA or the reverse direction solution 105, AFDCEBA

Change distance b to d from 44 to 4. What is the shortest route? Answer = 41, solution 12, ABDCEFA or the reverse direction solution 112, AFECDBA

Change distance a to b from 5 to 59. What is the shortest route? Answer = 86, solution 59, ADCBEFA or the reverse direction solution 113, AFEBCDA

Instructions

  1. Click the Clear button before entering new data to compute the shortest distance.
  2. If no distance is provided between two nodes, enter 1e9 in the input box.
    This large value simulates an unreachable path by making the total calculated distance extremely high, effectively excluding it from the shortest route.

Tip: Use 1e9 to represent missing connections—this ensures the algorithm treats them as non-viable paths.

This is interactive so try it. if the edge or line has no distance enter 1e9 (meaning 1,000,000,000) there is no available road to connect the two nodes. For example go to Drawing #1 example node A to node D no line so you enter 1e9 as input. (line is also called as edge, path, circuit in graph of traveling salesman analysis).

Graph Terminology Clarification

In the source material, the term "line" is used informally and is said to be interchangeable with edge, path, and circuit in graph of traveling salesman analysis. However, in formal graph theory, these terms have distinct meanings:

  • Edge: A direct connection between two nodes (also called a vertex).
  • Path: A sequence of edges that connects a series of nodes without repeating any node.
  • Circuit: A path that starts and ends at the same node, forming a closed loop.

While the source uses "line" as a general term, it's important to use precise terminology when teaching or analyzing graphs to avoid confusion.



ENTER YOUR NEW DATA HERE


a to b

a to e

a to d

a to c

b to e

b to c

c to d

c to e

d to e

b to d

e to f

a to f

b to f

d to f

c to f

shortest distance



Travelling Salesman Problem — Route Count Formulas

In a travelling salesman problem with 6 cities, the goal is to find the shortest possible route that starts at City A, visits each of the remaining five cities exactly once, and returns to City A.

The number of possible directed tours is given by:

P(n) = (n − 1)!

For six cities:

P(6) = 5! = 120

This matches the 120 possible combinations shown in the calculator (each representing a distinct ordered route).

In an undirected TSP, a route and its reverse direction represent the same path. To remove these duplicates, the number of unique tours is:

U(n) = (n − 1)! / 2

For six cities:

U(6) = 5! / 2 = 60

This means there are 60 unique undirected tours when reverse paths are treated as identical.



solution 1
A B C D E F A
solution 2
A B C D F E A
solution 3
A B C E D F A
solution 4
A B C E F D A
solution 5
A B C F D E A
solution 6
A B C F E D A
solution 7
A B D F E C A
solution 8
A B D F C E A
solution 9
A B D E C F A
solution 10
A B D E C F A
solution 11
A B D C F E A
solution 12
A B D C E F A
solution 13
A B E C D F A
solution 14
A B E C F D A
solution 15
A B E D C F A
solution 16
A B E D F C A
solution 17
A B E F D C A
solution 18
A B E F C D A
solution 19
A B F D E C A
solution 20
A B F D C E A
solution 21
A B F C D E A
solution 22
A B F C E D A
solution 23
A B F E C D A
solution 24
A B F E D C A
solution 25
A C B D E F A
solution 26
A C B D F E A
solution 27
A C B E F D A
solution 28
A C B E D F A
solution 29
A C B F E D A
solution 30
A C B F D E A
solution 31
A C D E F B A
solution 32
A C D E B F A
solution 33
A C D F E B A
solution 34
A C D F B E A
solution 35
A C D B E F A
solution 36
A C D B F E A
solution 37
A C E B D F A
solution 38
A C E B F D A
solution 39
A C E D B F A
solution 40
A C E D F B A
solution 41
A C E F B D A
solution 42
A C E F D B A
solution 43
A C F D E B A
solution 44
A C F D B E A
solution 45
A C F E B D A
solution 46
A C F E D B A
solution 47
A C F B E D A
solution 48
A C F B D E A
solution 49
A D B C E F A
solution 50
A D B C F E A
solution 51
A D B E C F A
solution 52
A D B E F C A
solution 53
A D B F E C A
solution 54
A D B F C E A
solution 55
A D C E B F A
solution 56
A D C E F B A
solution 57
A D C F B E A
solution 58
A D C F E B A
solution 59
A D C B E F A
solution 60
A D C B F E A
solution 61
A D E C B F A
solution 62
A D E C F B A
solution 63
A D E B C F A
solution 64
A D E B F C A
solution 65
A D E F B C A
solution 66
A D E F C B A
solution 67
A D F E B C A
solution 68
A D F E C B A
solution 69
A D F B E C A
solution 70
A D F B C E A
solution 71
A D F C B E A
solution 72
A D F C E B A
solution 73
A E C D B F A
solution 74
A E C D F B A
solution 75
A E C F D B A
solution 76
A E C F B D A
solution 77
A E C B D F A
solution 78
A E C B F D A
solution 79
A E D C B F A
solution 80
A E D C F B A
solution 81
A E D C B F A
solution 82
A E D C F B A
solution 83
A E D F C B A
solution 84
A E D F B C A
solution 85
A E F D B C A
solution 86
A E F D C B A
solution 87
A E F B D C A
solution 88
A E F B C D A
solution 89
A E F C B D A
solution 90
A E F C D B A
solution 91
A E B C D F A
solution 92
A E B C F D A
solution 93
A E B D C F A
solution 94
A E B D F C A
solution 95
A E B F C D A
solution 96
A E B F D C A
solution 97
A F C D E B A
solution 98
A F C D B E A
solution 99
A F C E B D A
solution 100
A F C E D B A
solution 101
A F C B E D A
solution 102
A F C B D E A
solution 103
A F D E B C A
solution 104
A F D E C B A
solution 105
A F D C E B A
solution 106
A F D C B E A
solution 107
A F D B E C A
solution 108
A F D B C E A
solution 109
A F E D C B A
solution 110
A F E D B C A
solution 111
A F E C B D A
solution 112
A F E C D B A
solution 113
A F E B C D A
solution 114
A F E B D C A
solution 115
A F B C E D A
solution 116
A F B C D E A
solution 117
A F B D E C A
solution 118
A F B D C E A
solution 119
A F B E D C A
solution 120
A F B E C D A



Additional Practice Exercises:


Drawing # 1 remember if no connection use 1e9 exponent format to write 1,000,000,000. Why? To make sure the algorithm exclude it as possible shortest distance.
Input A Input B Input C Input D
AB =4 AE =1e9 AD =1e9 AC =7
BE =1e9 BC =4 CD =5 CE =9
DE =3 BD =1e9 EF =5 AF =5
BF =1e9 DF =1e9 CF =1e9




Drawing # 1 Answer 26 Solution 1



Drawing # 2
Input A Input B Input C Input D
AB =4 AE =1e9 AD =6 AC =7
BE =1e9 BC =4 CD =5 CE =9
DE =3 BD =6 EF =5 AF =5
BF =1e9 DF =5 CF =1e9




Drawing # 2 Answer 26 Solution 1, Zoo to Library and Library to Home was added



Drawing # 3
Input A Input B Input C Input D
AB =5 AE =30 AD =1e9 AC =1e9
BE =1e9 BC =20 CD =2 CE =1e9
DE =2 BD =1e9 EF =15 AF =7
BF =10 DF =9 CF =15




Drawing # 3 Answer 51 Solution 1

Travelling Salesman 10 Cities

Travelling Salesman 9 Cities

Travelling Salesman 8 Cities

Travelling Salesman 7 Cities

Travelling Salesman 5 Cities

Travelling Salesman 4 Cities

Never Forget Again.
Store Your Knowledge in the
Cloud with IN-V-BAT-AI 🔗

IN-V-BAT-AI helps you recall information on demand—even when daily worries block your memory. It organizes your knowledge to make retrieval and application easier. 🔗

Source: How People Learn II: Learners, Contexts, and Cultures


🔗 Privacy 🔗 Disclaimer

Copyright 2026
Never Forget Again with IN-V-BAT-AI
INVenting Brain Assistant Tools using Artificial Intelligence
(IN-V-BAT-AI)

Established 2009
Unique visitors as of 9/26/2026 = 243,234
from 149 countries