Consensus strategies find a variety of applications in distributed coordination and decision making in multi-agent systems. In particular, average consensus plays a key role in a number of applications and is closely associated with two classes of digraphs, weight-balanced (for continuous-time systems) and bistochastic (for discrete-time systems). A weighted digraph is called balanced if, for each node, the sum of the weights of the edges outgoing from that node is equal to the sum of the weights of the edges incoming to that node. In addition, a weight-balanced digraph is bistochastic if all weights are nonnegative and, for each node, the sum of weights of edges incoming to that node and the sum of the weights of edges out-going from that node is unity; this implies that the corresponding weight matrix is column and row stochastic (i.e., doubly stochastic). We propose two distributed algorithms: one solves the weight-balance problem and the other solves the bistochastic matrix formation problem for a distributed system whose components (nodes) can exchange information via interconnection links (edges) that form an arbitrary, possibly directed, strongly connected communication topology (digraph). Both distributed algorithms achieve their goals asymptotically and operate iteratively by having each node adapt the (nonnegative) weights on its outgoing edges based on the weights of its incoming links (i.e., based on purely local information). We also provide examples to illustrate the operation, performance, and potential advantages of the proposed algorithms.