
"""simple docstring"""





def  lowerCamelCase__						(     __snake_case,	__snake_case,	__snake_case,	__snake_case      )				->						bool:


					"""simple docstring"""





					if graph[path[curr_ind - 1]][next_ver] == 0:
										return False

					# 2. Validate that next vertex is not already in path
					return not any(vertex == next_ver for vertex in path      )



def  lowerCamelCase__						(     __snake_case,	__snake_case,	__snake_case      )				->						bool:


					"""simple docstring"""





					if curr_ind == len(__snake_case      ):
										# return whether path exists between current and starting vertices
										return graph[path[curr_ind - 1]][path[0]] == 1

					# Recursive Step
					for next_ver in range(0,	len(__snake_case      )      ):
										if valid_connection(__snake_case,	__snake_case,	__snake_case,	__snake_case      ):
															# Insert current vertex  into path as next transition
															_UpperCamelCase									=    next_ver
															# Validate created path
															if util_hamilton_cycle(__snake_case,	__snake_case,	curr_ind + 1      ):
																				return True
															# Backtrack
															_UpperCamelCase									=    -1
					return False



def  lowerCamelCase__						(     __snake_case,	__snake_case = 0      )				->						list[int]:


					"""simple docstring"""





					_UpperCamelCase									=    [-1] * (len(__snake_case      ) + 1)
					# initialize start and end of path with starting index
					_UpperCamelCase									=    _UpperCamelCase									=    start_index
					# evaluate and if we find answer return path either return empty array
					return path if util_hamilton_cycle(__snake_case,	__snake_case,	1      ) else []








"""simple docstring"""





from collections.abc import Callable

import numpy as np



def  lowerCamelCase__						(     __snake_case,	__snake_case,	__snake_case,	__snake_case,	__snake_case      )				->						np.array:


					"""simple docstring"""





					_UpperCamelCase									=    int(np.ceil((x_end - xa) / step_size      )      )
					_UpperCamelCase									=    np.zeros((n + 1,)      )
					_UpperCamelCase									=    ya
					_UpperCamelCase									=    xa

					for k in range(__snake_case      ):
										_UpperCamelCase									=    y[k] + step_size * ode_func(__snake_case,	y[k]      )
										_UpperCamelCase									=    y[k] + (
										    (step_size / 2) * (ode_func(__snake_case,	y[k]      ) + ode_func(x + step_size,	__snake_case      ))
										)
										x += step_size

					return y


if __name__ == "__main__":
				import doctest

				doctest.testmod()






