<s>
The	O
activity	B-Algorithm
selection	I-Algorithm
problem	I-Algorithm
is	O
a	O
combinatorial	O
optimization	O
problem	O
concerning	O
the	O
selection	O
of	O
non-conflicting	O
activities	O
to	O
perform	O
within	O
a	O
given	O
time	O
frame	O
,	O
given	O
a	O
set	O
of	O
activities	O
each	O
marked	O
by	O
a	O
start	O
time	O
(	O
si	O
)	O
and	O
finish	O
time	O
(	O
fi	O
)	O
.	O
</s>
<s>
The	O
activity	B-Algorithm
selection	I-Algorithm
problem	I-Algorithm
is	O
also	O
known	O
as	O
the	O
Interval	B-Algorithm
scheduling	I-Algorithm
maximization	O
problem	O
(	O
ISMP	O
)	O
,	O
which	O
is	O
a	O
special	O
type	O
of	O
the	O
more	O
general	O
Interval	B-Algorithm
Scheduling	I-Algorithm
problem	O
.	O
</s>
<s>
The	O
activity	B-Algorithm
selection	I-Algorithm
problem	I-Algorithm
consists	O
in	O
finding	O
the	O
maximal	O
solution	O
set	O
(	O
S	O
)	O
of	O
non-conflicting	O
activities	O
,	O
or	O
more	O
precisely	O
there	O
must	O
exist	O
no	O
solution	O
set	O
S	O
 '	O
such	O
that	O
|S'|	O
>	O
|S|	O
in	O
the	O
case	O
that	O
multiple	O
maximal	O
solutions	O
have	O
equal	O
sizes	O
.	O
</s>
<s>
The	O
activity	B-Algorithm
selection	I-Algorithm
problem	I-Algorithm
is	O
notable	O
in	O
that	O
using	O
a	O
greedy	B-Algorithm
algorithm	I-Algorithm
to	O
find	O
a	O
solution	O
will	O
always	O
result	O
in	O
an	O
optimal	O
solution	O
.	O
</s>
<s>
A	O
pseudocode	B-Language
sketch	O
of	O
the	O
iterative	O
version	O
of	O
the	O
algorithm	O
and	O
a	O
proof	O
of	O
the	O
optimality	O
of	O
its	O
result	O
are	O
included	O
below	O
.	O
</s>
<s>
Line	O
1	O
:	O
This	O
algorithm	O
is	O
called	O
Greedy-Iterative-Activity-Selector	O
,	O
because	O
it	O
is	O
first	O
of	O
all	O
a	O
greedy	B-Algorithm
algorithm	I-Algorithm
,	O
and	O
then	O
it	O
is	O
iterative	O
.	O
</s>
<s>
There	O
's	O
also	O
a	O
recursive	O
version	O
of	O
this	O
greedy	B-Algorithm
algorithm	I-Algorithm
.	O
</s>
<s>
Since	O
,	O
and	O
the	O
activities	O
in	O
A	O
are	O
disjoint	B-Algorithm
by	O
definition	O
,	O
the	O
activities	O
in	O
B	O
are	O
also	O
disjoint	B-Algorithm
.	O
</s>
<s>
The	O
generalized	O
version	O
of	O
the	O
activity	B-Algorithm
selection	I-Algorithm
problem	I-Algorithm
involves	O
selecting	O
an	O
optimal	O
set	O
of	O
non-overlapping	O
activities	O
such	O
that	O
the	O
total	O
weight	O
is	O
maximized	O
.	O
</s>
<s>
Unlike	O
the	O
unweighted	O
version	O
,	O
there	O
is	O
no	O
greedy	O
solution	O
to	O
the	O
weighted	O
activity	B-Algorithm
selection	I-Algorithm
problem	I-Algorithm
.	O
</s>
<s>
However	O
,	O
a	O
dynamic	B-Algorithm
programming	I-Algorithm
solution	O
can	O
readily	O
be	O
formed	O
using	O
the	O
following	O
approach	O
:	O
</s>
