Given some points in the Euclidean space, find a plane satisfying some restrictions In a 3-D Cartesian coordinates, suppose we are given $n$ points and their coordinate values in the form $(x,y,z)$. Obviously there are uncountable planes which divide those points into two groups, some on the one side of the plane and some on the other side. 
For example, two points $(0,0,0)$ and $(2,0,0)$, the plane $x=1$ devides them into two groups. We define a set S to conclude those planes. For every such plane $P$, along with those $n$ points, we define $f(P)=max(d(x,P)+d(y,P))$, $d(x,P)$ being the distance between the point $x$ and the plane $P$. $x$ and $y$ belong to those given $n$ points but are from different groups.
The question is:

How to find the function of the plane $W$ ($W$ is a member of $S$) such that $f(W)$ is the smallest compared with any other plane belonging to $S$? Is there any simple method?

Or

Try to find the value of $f(W)$ in the condition above.

Advice of either of the questions would help!
 A: It is not entirely clear whether you know in advance what the groups should be, or you want to let the algorithm decide this. 
Case 1. You already know to which of two groups each of your $n$ points belongs; the plane is needed as a tool to classify other points that you may be given later. This is a classification problem of supervised learning, and  the appropriate tool is called a support vector machine. 
Case 2. You don't know to which group your points belong; you need the plane to tell you this. Now we have a problem of unsupervised learning, which is going to be harder. You'll find some results and references in Unsupervised SVMs:
On the Complexity of the Furthest Hyperplane Problem. From the abstract: 

This paper introduces the Furthest Hyperplane Problem (FHP), which is an unsupervised counterpart of Support Vector Machines. Given a set of $n$ points in $\mathbb R^d$, the objective is to produce the hyperplane (passing through the origin) which maximizes the separation margin, that is, the minimal distance between the hyperplane and any input point.

A: My convex intuition says the following. 
Let $A$ be the set consisting of $n$ given points. As I understood you, $f(P)$ should be equal to a width $w_r(A)$ of the set $A$  in the direction $r$ orthogonal to the plane $P$. So you have to find a minimal width of the set $A$. A width of a set in the given direction is a known notion, hence should be a information about it in the Internent. Moreover, my convex intuitions suggests that for each direction $r$ the width $w_r(A)$ is equal to a width $w_r(conv(A))$ of the convex hull $conv(A)$ of the set $A$. The set $conv(A)$ is a polytope and the minimal value of $w_r(conv(A))$ is achieved when $r$ is orthogonal to a face of the polytope $conv(A)$. In this case the minimal value of $f(P)$ can be found as follows. 
For each triple $u,v,w$ of not-collinear points of $A$ consider a plane $P$, going through $u,v,w$.  The plane $P$ is determined by an equation $ax+by+cz+d=0$. Then the direction orthogonal  to the plane $P$ is $r=(a,b,c)$. For each point $t\in A$ the projection of the point
$t=(x,y,z)$ into direction $r$ is equal to $p_r(t)= ax+by+cz$. Put $p_r(A)=\{p_r(t):t\in A\}$. Then the width $f(P)=w_r(A)=\max p_r(A)-\min p_r(A)$. Then the required minimum of $f(P)$
should be equal to $\min\{w_r(A)\}$, where the set of all such $r$ is described above. 
