latex算法书写
来源:互联网 发布:win7系统数据恢复 编辑:程序博客网 时间:2024/06/05 21:57
\documentclass[a4paper,12pt]{cctart}
\usepackage{amsmath,amssymb,graphicx,subfigure}
\usepackage{algorithm}
\usepackage{algorithmic}
\title{}
\author{}
\date{}
\textheight=25cm \textwidth=15cm \topmargin=-2cm
\oddsidemargin=0cm \evensidemargin=0cm
\begin{document}
\begin{algorithm}[H]
\renewcommand{\algorithmicrequire}{\textbf{Input:}}
\renewcommand{\algorithmicensure}{\textbf{Output:}}
\begin{algorithmic}[1]
\REQUIRE a network $N:=N(x,y)$ and a zero flow $f$ in $N$
\ENSURE a maximum flow $f$ returned by $2M+1$ iterations
\STATE set $k=0$ and $s=0$
\IF {$k=0$}
\STATE choose the increment path shown in figure 8-1-1-b
\STATE set $s=s+1$
\ELSE
\STATE choose the increment path shown in figure 8-1-1-c
\STATE set $s=s+1$
\ENDIF
\IF {either $f((u,y))$ or $f((v,y))$ is less than $M$}
\STATE set $k=1-k$
\RETURN to step 2
\ELSE
\STATE do the Max-Flow Min-Cut Algorithm to show that $f$ is a maximum flow
\STATE set $s=s+1$
\ENDIF
\RETURN $(f,s)$ where $s$ means the number of iterations used
\end{algorithmic}
\end{algorithm}
\end{document}
\begin{algorithm}[H]
\renewcommand{\algorithmicrequire}{\textbf{Input:}}
\renewcommand{\algorithmicensure}{\textbf{Output:}}
\begin{algorithmic}[1]
\REQUIRE a network $N:=N(x,y)$ and a zero flow $f$ in $N$
\ENSURE a maximum flow $f$ returned by $2M+1$ iterations
\STATE set $k=0$ and $s=0$
\IF {$k=0$}
\STATE choose the increment path shown in figure 8-1-1-b
\STATE set $s=s+1$
\ELSE
\STATE choose the increment path shown in figure 8-1-1-c
\STATE set $s=s+1$
\ENDIF
\IF {either $f((u,y))$ or $f((v,y))$ is less than $M$}
\STATE set $k=1-k$
\RETURN to step 2
\ELSE
\STATE do the Max-Flow Min-Cut Algorithm to show that $f$ is a maximum flow
\STATE set $s=s+1$
\ENDIF
\RETURN $(f,s)$ where $s$ means the number of iterations used
\end{algorithmic}
\end{algorithm}
\end{document}
阅读全文
0 0
- latex算法书写
- Latex 如何书写算法流程
- Latex 书写 IEEE 会议论文
- Latex:算法
- 使用LaTeX书写数学公式简要入门
- 使用LaTeX书写数学公式简要入门
- LaTeX分情况公式的书写
- Linux下Latex书写中文的点滴体会
- 在Ubuntu上试验Latex 中文书写成功
- Latex算法排版
- LaTeX算法排版例子
- Latex 算法编辑
- latex算法排版
- LaTeX算法排版例子
- latex中输入算法
- LaTex:算法排版
- Latex 算法Algorithm
- latex 插入算法
- 剑指Offer(五)用两个栈实现队列
- BZOJ 4589 Hard Nim(博弈论+FWT+快速幂)
- (sklearn)线性判别分析LinearDiscriminantAnalysis
- 面试题:fun(484)的返回值是
- Python 正则表达式 关于邮箱地址
- latex算法书写
- p2p项目总结
- mysql日期时间操作函数详解
- 【SpringMVC】文件上传Expected MultipartHttpServletRequest: is a MultipartResolver错误解决
- Testing Round #14 (Unrated) A
- POJ 刷题系列:1860. Currency Exchange
- 【Java学习笔记】内部类
- 牛客网 Wannafly挑战赛6 逆序对(思路)
- 在IAR中的workspace增加下载代码选项