Optimize a parallelized program to optimize train schedules
Do not use using namespace std as it could cause clashing issues, which will introduce bugs.  More info about that here.
This is very unorganized:


#include &lt;iostream&gt;
#include &lt;string&gt;
#include &lt;vector&gt;
#include &lt;time.h&gt;
#include &lt;cmath&gt;
#include &lt;iterator&gt;

#include &lt;algorithm&gt;

#include &lt;fstream&gt;
#include &lt;stdlib.h&gt;
#include &lt;sstream&gt;

#include &lt;stdlib.h&gt;

#include &lt;thread&gt;
#include &lt;random&gt;



Steps to improve this:


Make sure there aren't any libraries that you aren't currently using or have repeated.
Make sure you aren't using any C libraries (which end with .h).  They should be replaced with the equivalent C++ library so that everything will be in the std namespace.
Sort them in a certain order for organization, such as alphabetically.  This will make it easier to locate certain libraries during maintaining.


Assuming every library is still being used, this is what it could look like:

#include &lt;algorithm&gt;
#include &lt;cmath&gt;
#include &lt;cstdlib&gt;
#include &lt;ctime&gt;
#include &lt;fstream&gt;
#include &lt;iostream&gt;
#include &lt;iterator&gt;
#include &lt;random&gt;
#include &lt;sstream&gt;
#include &lt;string&gt;
#include &lt;thread&gt;
#include &lt;vector&gt;


This is one #include shorter because you've included &lt;stdlib.h&gt; twice.  Had this list been organized from the beginning, this wouldn't have been likely to happen.
Do not use global variables:


vector&lt;Zug&gt; Zuege;

int Planungsintervall;
int AnzahlZuege;
int AnzahlSchattenzuege;



They are accessible throughout the entire file or program, and can possibly be modified without your knowledge.  This can greatly hurt maintainability and also introduce bugs.  You should keep them in local scope, such as in a function, and pass them to other functions as needed.  This will make it much easier to keep track of their locality and determine how they're used.
The inline keyword likely won't offer you any benefit here.  The compiler is free to decide what should really be inlined and can ignore any explicit use of it.  It merely serves as a hint.
There is absolutely no need to call std::rand() when you're using C++11 and have already included &lt;random&gt;.  You should utilize this library and ditch std::rand() altogether.

Regarding the usage of std::rand() itself, you don't even call std::srand(), meaning you'll get the same random values with each call to std::rand().  Have you not even noticed this?
Why are you mixing std::vectors and dynamically-allocated arrays?  Vectors are the same type of array, but much more specialized.  You should ditch all the arrays and just use vectors (or any suitable storage container).  You end up passing these arrays (specifically the pointer to their first respective elements), which can get very nasty in C++, especially because memory-management will now be in your hands.  Just utilize storage containers and let them handle the dirty work for you (which is very necessary, as you fail to deallocate memory with delete, causing the whole program to leak memory).  They will also allow you to ditch the size variables since storage containers already keep track of their sizes (accessible via size()).
Since you use argv[1] in main() as the only command line argument, I assume that you're only expecting one additional argument.

In order to make sure that this argument is provided, check the value of argc at the start, before using argv[1].  If it's less than 2, terminate the program.  You may also print an error message to inform the user of this error.

if (argc &lt; 2)
{
    std::cerr &lt;&lt; "A filename argument is required!";
    return EXIT_FAILURE;
}





To sum it up:

This is quite broken and messy.  I'm sure there are other issues besides the ones I've mentioned, but this should address many of them.  Before worrying about optimization, I'd recommend cleaning this up and making sure it runs smoothly and correctly.