Exercises lecture 5

ClearAll["Global`*"];SetDirectory[NotebookDirectory[]]

Exercise 1: Consider this list of points on a plane: points= {{1,6},{4,1.5},{0.5,2.5},{3,3},{1,5}}. Find by trying out systematically all permutations of the points the minimal path that starts from the origin, touches all the points once and comes back to the origin.
Check your result by using the built-in function  FindShortestTour. Plot the resulting path through the points.

Exercise 2: Find the Ricci scalar for a 3D spatial non-flat metric. You can use one or both of the following forms

Cartesian coordinates

Clear[metric];
metric:=DiagonalMatrix[
a^2*{1,1,1}/(1+k/4*(x^2+y^2+z^2))^2]

coord={x,y,z};

Spherical coordinates

Clear[metric];
metric:=DiagonalMatrix[
a^2*{1/(1-k*r^2),r^2,r^2*Sin[theta]^2}]

coord={r,theta,phi};