Design O(n^2*2^n) DP TSP, run on 5-vertex complete graph

Given a JSON string containing a weighted, directed complete graph with exactly five vertices, compute the minimum-cost Hamiltonian cycle that starts at vertex 0, visits every other vertex exactly once, and returns to vertex 0. The input object has the shape { "n": 5, "graph": number[5][5] }. graph[i][j] is the cost of traveling from i to j; diagonal entries are zero and every off-diagonal cost is an integer from 1 through 1000. Return the minimum tour cost as a number. The start vertex is fixed at zero, so rotations of a tour are not separate answers.

Examples
Input: "{\"n\":5,\"graph\":[[0,3,314,321,328],[323,0,4,344,351],[346,353,0,5,374],[369,376,383,0,6],[7,399,406,413,0]]}"
Output: 25
Hints

Design O(n^2*2^n) DP TSP, run on 5-vertex complete graph

Given a JSON string containing a weighted, directed complete graph with exactly five vertices, compute the minimum-cost Hamiltonian cycle that starts at vertex `0`, visits every other vertex exactly once, and returns to vertex `0`. The input object has the shape `{ "n": 5, "graph": number[5][5] }`. `graph[i][j]` is the cost of traveling from `i` to `j`; diagonal entries are zero and every off-diagonal cost is an integer from 1 through 1000. Return the minimum tour cost as a number. The start vertex is fixed at zero, so rotations of a tour are not separate answers.