<?xml version="1.0" encoding="UTF-8"?>

<record version="1" id="2778">
 <title>weighted path length</title>
 <name>WeightedPathLength</name>
 <created>2002-03-08 09:43:24</created>
 <modified>2002-03-08 09:43:24</modified>
 <type>Definition</type>
 <creator id="6" name="Logan"/>
 <author id="6" name="Logan"/>
 <classification>
	<category scheme="msc" code="05C05"/>
 </classification>
 <related>
	<object name="ExternalPathLength"/>
	<object name="ExtendedBinaryTree"/>
	<object name="CompleteBinaryTree"/>
	<object name="MinimumWeightedPathLength"/>
 </related>
 <preamble>\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{graphicx}</preamble>
 <content>Given an extended binary tree $T$ (that is, simply any complete binary tree, where leafs are denoted as \emph{external nodes}), associate weights with each external node.  The \emph{weighted path length} of $T$ is the sum of the product of the weight and path length of each external node, over all external nodes.

Another formulation is that weighted path length is $\sum w_jl_j$ over all external nodes $j$, where $w_j$ is the weight of an external node $j$, and $l_j$ is the distance from the root of the tree to $j$.  If $w_j = 1$ for all $j$, then weighted path length is exactly the same as external path length.

\subsubsection*{Example}

Let $T$ be the following extended binary tree.  Square nodes are external nodes, and circular nodes are internal nodes.  Values in external nodes indicate weights, which are given in this problem, while values in internal nodes represent the weighted path length of subtrees rooted at those nodes, and are calculated from the given weights and the given tree.  The weight of the tree as a whole is given at the root of the tree.

\begin{center}
\includegraphics{tree.10}
\end{center}

This tree happens to give the minimum weighted path length for this particular set of weights.</content>
</record>
