<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://qetlab.com/wiki/index.php?action=history&amp;feed=atom&amp;title=One_factorization</id>
	<title>One factorization - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://qetlab.com/wiki/index.php?action=history&amp;feed=atom&amp;title=One_factorization"/>
	<link rel="alternate" type="text/html" href="https://qetlab.com/wiki/index.php?title=One_factorization&amp;action=history"/>
	<updated>2026-04-16T10:06:21Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.35.3</generator>
	<entry>
		<id>https://qetlab.com/wiki/index.php?title=One_factorization&amp;diff=540&amp;oldid=prev</id>
		<title>Nathaniel: Created page with &quot;{{Function |name=one_factorization |desc=Computes a 1-factorization of a list of objects |upd=November 6, 2014 |rel=perfect_matchings |cat=List of functions#Helper_funct...&quot;</title>
		<link rel="alternate" type="text/html" href="https://qetlab.com/wiki/index.php?title=One_factorization&amp;diff=540&amp;oldid=prev"/>
		<updated>2014-11-07T15:12:40Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;{{Function |name=one_factorization |desc=Computes a 1-factorization of a list of objects |upd=November 6, 2014 |rel=&lt;a href=&quot;/Perfect_matchings&quot; title=&quot;Perfect matchings&quot;&gt;perfect_matchings&lt;/a&gt; |cat=List of functions#Helper_funct...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{Function&lt;br /&gt;
|name=one_factorization&lt;br /&gt;
|desc=Computes a 1-factorization of a list of objects&lt;br /&gt;
|upd=November 6, 2014&lt;br /&gt;
|rel=[[perfect_matchings]]&lt;br /&gt;
|cat=[[List of functions#Helper_functions|Helper functions]]&lt;br /&gt;
|v=0.50&lt;br /&gt;
|helper=1}}&lt;br /&gt;
&amp;lt;tt&amp;gt;'''one_factorization'''&amp;lt;/tt&amp;gt; is a [[List of functions|function]] that returns a 1-factorization of a given list of objects. That is, for a list of $n$ objects, it returns $n-1$ ways of pairing up all of the objects such that each pair of objects occurs exactly once (and thus is essentially a [http://en.wikipedia.org/wiki/Graph_factorization#1-factorization 1-factorization] of the complete graph on $n$ vertices).&lt;br /&gt;
&lt;br /&gt;
Alternatively, this function can be thought of as scheduling a [http://en.wikipedia.org/wiki/Round-robin_tournament round-robin tournament]: given an even number $n$ of players, it shows how each player can play against every other player by pairs of players playing $n/2$ games concurrently $n-1$ times (which is optimal).&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
* &amp;lt;tt&amp;gt;FAC = one_factorization(N)&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Argument descriptions==&lt;br /&gt;
* &amp;lt;tt&amp;gt;N&amp;lt;/tt&amp;gt;: Either an even integer, indicating that you would like a 1-factorization of the integers $1, 2, \ldots, N$, or a vector containing an even number of distinct entries, indicating that you would like a 1-factorization of those entries.&lt;br /&gt;
&lt;br /&gt;
==Examples==&lt;br /&gt;
===A 1-factorization of six objects===&lt;br /&gt;
The following code generates a 1-factorization of the numbers $1,2,3,4,5,6$:&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;gt;&amp;gt; one_factorization(6)&lt;br /&gt;
&lt;br /&gt;
ans =&lt;br /&gt;
&lt;br /&gt;
     1     6     5     2     4     3&lt;br /&gt;
     2     6     1     3     5     4&lt;br /&gt;
     3     6     2     4     1     5&lt;br /&gt;
     4     6     3     5     2     1&lt;br /&gt;
     5     6     4     1     3     2&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each row of the output is a single perfect matching (i.e., a way of pairing up the &amp;lt;tt&amp;gt;N&amp;lt;/tt&amp;gt; objects), which are read &amp;quot;naively&amp;quot; left-to-right. For example, the first row of the output above indicates the following pairing: $\{\{1,6\},\{5,2\},\{4,3\}\}$. The other rows are similar, and each pair occurs exactly once in the entire matrix (e.g., the pair $\{1,3\}$ occurs only in the 2nd row).&lt;br /&gt;
&lt;br /&gt;
{{SourceCode|name=one_factorization|helper=1}}&lt;/div&gt;</summary>
		<author><name>Nathaniel</name></author>
	</entry>
</feed>