Related terms – Terms that feature in post of current term

Just banged this out real quick, it should be a start at least. The basic concept here was to get ALL the posts tagged with the main person (in this case, Tom Cruise, you’ll have to setup that variable on your own. Once you have those, iterate through them, and foreach movie (Top Gun, Tropic Thunder, Mission Impossible, etc), get the other actors for that movie. From there you generate an array containing the actor slugs (though you could use IDs or anything else in the object, really, suit it to your needs) as keys and the relevance (only crawling out one level) as the value. Then you do an arsort to get it with the most relevant up top, which will allow you to slap a for( $i=0; $i<5; $i++) on there and do the boring HTML and stuff.

$wp_query = new WP_Query;
$args = array(
    // post basics
    'post_type'      => 'Movies',  // check capitalization, make sure this matches your post type slug
    'post_status'    => 'publish', // you may not need this line.
    'posts_per_page' => 10,        // set this yourself, 10 is a placeholder
    // taxonomy
    'tax_query'      => array(
        array(
            'taxonomy' => 'actors', // slug for desired tag goes here
            'field'    => 'slug',
            'terms'    => 'Tom Cruise', // should work without a slug, try it both ways...and use a variable, don't hardcode
        )
    )
);

$results = $wp_query->query( $args );

$related = array();

if( count( $results ) > 0 ) {
    foreach( $results as $result ) {
        $new_related = get_the_terms( $result->ID, 'actors' ); //get terms for this post
        if( is_array( $new_related ) ) {
            foreach( $new_related as $v ) {
                $name = $v->name;
                if( array_key_exists( $name, $related ) )
                    $related[$name]++; // add to total if it's already there
                else
                    $related[$name] = 1; // initialize if it does not
            }
        }
    }
    arsort( $related, SORT_NUMERIC );
}